blob: 2252ed01092c4d8ab2263b646f627e02cad85e33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
==============================
How to use Django with Granian
==============================
Granian_ is a Rust-based high-performance HTTP server for Python applications,
supporting ASGI and WSGI interfaces.
.. _Granian: https://github.com/emmett-framework/granian
Installing Granian
==================
You can install Granian with ``pip``:
.. code-block:: shell
python -m pip install granian
Running Django in Granian
=========================
When Granian is installed, a ``granian`` command is available which runs WSGI
applications. Granian needs to be called with the location of a module
containing a WSGI application object named ``application``, using the
``--interface wsgi`` option.
For a typical Django project, invoking Granian would look like:
.. code-block:: shell
granian myproject.wsgi:application --interface wsgi
This will start one process listening on ``127.0.0.1:8000``. It requires that
your project be on the Python path; to ensure that, run this command from the
same directory as your ``manage.py`` file.
For more advanced usage, please read the `Granian documentation <Granian_>`_.
|