Skip to content

Commit 83d37fa

Browse files
delsimdelsim
and
delsim
authored
Enable use of channels and Django versions 4.0 (#470)
* Enable use of channels and Django versions 4.0 * Bump version and update versions in setup file --------- Co-authored-by: delsim <[email protected]>
1 parent 76b0076 commit 83d37fa

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

demo/demo/asgi.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424

2525
import os
2626
import django
27-
from channels.routing import get_default_application
27+
from channels.routing import get_default_application, ProtocolTypeRouter
28+
from django.core.asgi import get_asgi_application
2829

2930
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")
3031

3132
django.setup()
3233

33-
application = get_default_application()
34+
from django_plotly_dash.routing import application
35+

demo/demo/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34+
'daphne',
3435
'django.contrib.admin',
3536
'django.contrib.auth',
3637
'django.contrib.contenttypes',
3738
'django.contrib.sessions',
3839
'django.contrib.messages',
3940
'django.contrib.staticfiles',
4041

41-
'channels',
4242
'bootstrap4',
4343

4444
'django_plotly_dash.apps.DjangoPlotlyDashConfig',
@@ -82,7 +82,7 @@
8282

8383
WSGI_APPLICATION = 'demo.wsgi.application'
8484

85-
ASGI_APPLICATION = 'demo.routing.application'
85+
ASGI_APPLICATION = 'demo.asgi.application'
8686

8787
# Database
8888
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

django_plotly_dash/routing.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@
5858
'websocket': AuthMiddlewareStack(URLRouter([re_path(pipe_ws_endpoint_name(), MessageConsumer if OLDER_CHANNELS else MessageConsumer.as_asgi()),])),
5959
'http': AuthMiddlewareStack(URLRouter(http_routes)),
6060
})
61+

django_plotly_dash/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
2424
'''
2525

26-
__version__ = "2.2.2"
26+
__version__ = "2.3.0"

prepare_demo

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ cd demo
88
#
99
# Run debug server. Use the nostatic flag to enable the use of whitenose rather than the standard Django debug handling
1010
#
11-
./manage.py runserver --nostatic
11+
#./manage.py runserver --nostatic
12+
./manage.py runserver

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dpd-components
44

55
dash-bootstrap-components
66

7-
channels>=2.0
8-
Django>=3.2,<5.0.0
7+
channels>=4.0
8+
Django>=4.0.0
99
Flask>=1.0.2
1010
Werkzeug

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
'dash-bootstrap-components',
4848

49-
'channels>=2.0',
50-
'Django>=3.2,<5.0.0',
49+
'channels>=4.0',
50+
'Django>=4.0.0',
5151
'Flask>=1.0.2',
5252
'Werkzeug',
5353
],

0 commit comments

Comments
 (0)