mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
doc: mention how to configure Daphne (channels interface server)
Closes https://github.com/jazzband/django-configurations/pull/164.
This commit is contained in:
parent
4fea22bd16
commit
6ed4559c92
1 changed files with 24 additions and 0 deletions
|
|
@ -252,3 +252,27 @@ the environment variable accordingly:
|
|||
|
||||
Please note that the sphinx callable has been moved from ``configurations`` to
|
||||
``configurations.sphinx``.
|
||||
|
||||
|
||||
Channels
|
||||
--------
|
||||
|
||||
If you want to deploy a project that uses the Django channels with
|
||||
`Daphne <http://github.com/django/daphne/>` as the
|
||||
`interface server <http://channels.readthedocs.io/en/latest/deploying.html#run-interface-servers>`
|
||||
you have to use a asgi.py script similar to the following:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import os
|
||||
from configurations import importer
|
||||
from channels.asgi import get_channel_layer
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_project.settings")
|
||||
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
|
||||
|
||||
importer.install()
|
||||
|
||||
channel_layer = get_channel_layer()
|
||||
|
||||
That will properly load your django-configurations powered settings.
|
||||
|
|
|
|||
Loading…
Reference in a new issue