Open ckrew opened 1 month ago
According to the django channel 4.0.0 release notes, daphne is now decoupled from channels. If users want to run daphne with runserver, then daphne must be added to the installed apps explicitly in the settings.
INSTALLED_APPS = [ "daphne", ... ]
According to the django channel 4.0.0 release notes, daphne is now decoupled from channels. If users want to run daphne with runserver, then daphne must be added to the installed apps explicitly in the settings.
INSTALLED_APPS = [ "daphne", ... ]
I've been playing around with this for bokeh-django
and ran into this error:
ERRORS:
?: (daphne.E001) Daphne must be listed before django.contrib.staticfiles in INSTALLED_APPS.
This is a pretty easy fix if you have access to the settings.py
file, but with Tethys we limit modifying the settings to the portal_config.yml
file. Currently all INSTALLED_APPS
in the portal_config.yml
will be appended to the default list in the tethys_portal/settings.py
file. The only way around this currently is to use the INSTALLED_APPS_OVERRIDE
setting, but that requires that users know and list all of the default apps that are needed.
I'm planning to test adding daphne
as an installed app in Tethys. My hope is that it will not change anything for versions of daphne<4
, while "just working" with daphne=4
.
On a related note, since channels=4.x
is decoupled from daphne
it depends on daphne=4.x
. Using channels=4
with daphne=3
will not work.
However, when I try to install an unpinned version of django
and channels
from conda-forge
it resolves to:
+ channels 4.0.0 pyhd8ed1ab_0 conda-forge/noarch Cached
+ daphne 3.0.2 pyhd8ed1ab_0 conda-forge/noarch Cached
+ django 5.1 pyhd8ed1ab_0 conda-forge/noarch Cached
Which is a bit strange since channels=4
requires daphne=4
, and if you try to pin channels=4
and django=5
it errors out (see below).
By specifying daphne=4
it forces django
to 4.2:
Trying to force django=5
, channels=4.1
, and daphne=4
results in:
$ mamba create -n django-channels django=5 channels=4.1 daphne=4
...
Encountered problems while solving:
- package channels-4.1.0-pyhd8ed1ab_0 requires django >=3.2,<5, but none of the providers can be installed
This appears to be a bug in the conda packaging since the pyproject.toml
for channels=4.1
specifies:
install_requires =
Django>=4.2
asgiref>=3.6.0,<4
The mismatch in how conda resolves the versions should be fixed with:
https://github.com/conda-forge/channels-feedstock/pull/17
and
Describe the bug When using a consumer class is used to create a websocket, the daphne server does not spin up on the "tethys manage start" command and therefore a websocket is never created. The outputs from the "tethys manage start" command show "Starting development server at http://127.0.0.1:8000/"
To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect a daphne server to spin up and have a message like "Starting ASGI/Daphne version 4.1.2 development server at http://127.0.0.1:8000/".
Tethys Environment Information channels=4.x