-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies, moving to ASGI3
ASGI3: - Update application routing and middleware to new standards. - asgiref's `sync_to_async` now defaults to `thread_sensitive=True` Set `thread_sensitive=False` on blocking calls like mp.Event.wait() to prevent deadlocks. Django 3.2: - set DEFAULT_AUTO_FIELD to its effective old value. At some point, a migration should be written to migrate automatic primary keys from AutoField to AutoBigField. requirements.txt: - lots of updates - drop ipython and dependencies; it's useful, but not required. PyJWT: - update exception names subscribers: - Update _ChannelLayerMixin based on changes in Django Channels.
- Loading branch information
Showing
9 changed files
with
94 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,55 @@ | ||
aioredis==1.3.1 | ||
asgiref==3.2.10 | ||
astroid==2.4.2 | ||
asgiref==3.4.1 | ||
astroid==2.6.2 | ||
async-timeout==3.0.1 | ||
attrs==20.2.0 | ||
autobahn==20.12.3 | ||
attrs==21.2.0 | ||
autobahn==21.3.1 | ||
Automat==20.2.0 | ||
autopep8==1.5.4 | ||
backcall==0.2.0 | ||
cffi==1.14.2 | ||
channels==2.4.0 | ||
channels-redis==3.1.0 | ||
cffi==1.14.6 | ||
channels==3.0.4 | ||
channels-redis==3.3.0 | ||
constantly==15.1.0 | ||
cryptography==3.3.2 | ||
Cython==0.29.21 | ||
daphne==2.5.0 | ||
decorator==4.4.2 | ||
Django==3.1.8 | ||
django-cors-headers==3.5.0 | ||
djangorestframework==3.11.2 | ||
cryptography==3.4.7 | ||
Cython==0.29.24 | ||
daphne==3.0.2 | ||
decorator==5.0.9 | ||
Django==3.2.5 | ||
django-cors-headers==3.7.0 | ||
djangorestframework==3.12.4 | ||
djangorestframework-camel-case==1.2.0 | ||
entrypoints==0.3 | ||
flake8==3.8.3 | ||
gssapi==1.6.9 | ||
hiredis==1.1.0 | ||
hyperlink==20.0.1 | ||
idna==2.10 | ||
importlib-metadata==1.7.0 | ||
incremental==17.5.0 | ||
ipython==7.18.1 | ||
ipython-genutils==0.2.0 | ||
isort==5.5.1 | ||
jedi==0.17.2 | ||
lazy-object-proxy==1.4.3 | ||
flake8==3.9.2 | ||
gssapi==1.6.14 | ||
hiredis==2.0.0 | ||
hyperlink==21.0.0 | ||
idna==3.2 | ||
importlib-metadata==4.6.1 | ||
incremental==21.3.0 | ||
isort==5.9.2 | ||
lazy-object-proxy==1.6.0 | ||
mccabe==0.6.1 | ||
msgpack==1.0.0 | ||
parso==0.7.1 | ||
pexpect==4.8.0 | ||
pickleshare==0.7.5 | ||
prompt-toolkit==3.0.7 | ||
ptyprocess==0.6.0 | ||
msgpack==1.0.2 | ||
pyasn1==0.4.8 | ||
pyasn1-modules==0.2.8 | ||
pycodestyle==2.6.0 | ||
pycodestyle==2.7.0 | ||
pycparser==2.20 | ||
pyflakes==2.2.0 | ||
Pygments==2.7.4 | ||
PyHamcrest==2.0.2 | ||
PyJWT==1.7.1 | ||
PyYAML==5.4 | ||
pylint==2.6.0 | ||
pylint-django==2.3.0 | ||
pyflakes==2.3.1 | ||
PyJWT==2.1.0 | ||
pylint==2.9.3 | ||
pylint-django==2.4.4 | ||
pylint-plugin-utils==0.6 | ||
pyOpenSSL==19.1.0 | ||
pytz==2020.1 | ||
git+git://github.com/asedeno/python-zephyr@roost-fork#PyZephyr | ||
service-identity==18.1.0 | ||
setproctitle==1.1.10 | ||
six==1.15.0 | ||
sqlparse==0.3.1 | ||
toml==0.10.1 | ||
traitlets==5.0.4 | ||
Twisted==20.3.0 | ||
txaio==20.4.1 | ||
typed-ast==1.4.1 | ||
wcwidth==0.2.5 | ||
pyOpenSSL==20.0.1 | ||
pytz==2021.1 | ||
PyYAML==5.4.1 | ||
PyZephyr @ git+git://github.com/asedeno/python-zephyr@3c4edc9c02bc023c55a625b686af86f3d226a505 | ||
service-identity==21.1.0 | ||
setproctitle==1.2.2 | ||
six==1.16.0 | ||
sqlparse==0.4.1 | ||
toml==0.10.2 | ||
Twisted==21.2.0 | ||
txaio==21.2.1 | ||
typed-ast==1.4.3 | ||
typing-extensions==3.10.0.0 | ||
wrapt==1.12.1 | ||
zipp==3.1.0 | ||
zope.interface==5.1.0 | ||
zipp==3.5.0 | ||
zope.interface==5.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from channels.middleware import BaseMiddleware | ||
|
||
|
||
class DaphneRootPathForWebsockets(BaseMiddleware): | ||
# pylint: disable=too-few-public-methods | ||
async def __call__(self, scope, receive, send): | ||
# Copy scope to stop changes going upstream | ||
scope = dict(scope) | ||
# Daphne does not deal with the daphne-root-path header for websockets, | ||
# so we will deal with it here. | ||
headers = dict(scope['headers']) | ||
root_path = headers.get(b'daphne-root-path', b'').decode() | ||
path = scope['path'] | ||
if root_path and path.startswith(root_path): | ||
scope['path'] = path[len(root_path):] | ||
return await self.inner(scope, receive, send) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
from django.conf.urls import url | ||
from channels.routing import ProtocolTypeRouter, URLRouter | ||
|
||
from roost_backend.consumers import UserSocketConsumer | ||
# from roost_backend.middleware import JWTAuthTokenMiddleware | ||
|
||
# pylint: disable=invalid-name | ||
application = ProtocolTypeRouter({ | ||
# Empty for now (http->django views is added by default) | ||
# This would be cool if roost did websocket auth by header. | ||
# 'websocket': JWTAuthTokenMiddleware( | ||
# URLRouter([ | ||
# url(r'^v1/socket/websocket', UserSocketConsumer), | ||
# ]) | ||
# ), | ||
'websocket': URLRouter([ | ||
url(r'^v1/socket/websocket', UserSocketConsumer), | ||
]), | ||
}) | ||
websocket_urlpatterns = [ | ||
url(r'^v1/socket/websocket', UserSocketConsumer.as_asgi()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters