Skip to content

Commit

Permalink
Upgrade dependencies in Django server example
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 14, 2023
1 parent b068fd6 commit 00b3166
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
18 changes: 14 additions & 4 deletions examples/server/wsgi/django_socketio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ You can run it with the Django development web server:
python manage.py runserver
```

When running in this mode, you will see a warning indicating that the WebSocket
transport is not available, which is not supported by this web server.
When running in this mode, you will get an error message:

See the documentation for information on supported deployment methods that you
can use to add support for WebSocket.
RuntimeError: Cannot obtain socket from WSGI environment.

This is expected, and it happens because the Django web server does not support
the WebSocket protocol. You can ignore the error, as the server will still work
using long-polling.

To run the application with WebSocket enabled, you can use the Gunicorn web
server as follows:

gunicorn -b :8000 --threads 100 --access-logfile - django_socketio.wsgi:application

See the documentation for information on other supported deployment methods
that you can use to add support for WebSocket.
14 changes: 9 additions & 5 deletions examples/server/wsgi/django_socketio/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
asgiref==3.5.2
asgiref==3.6.0
backports.zoneinfo==0.2.1
bidict==0.22.0
Django==4.1.9
python-engineio==4.3.2
python-socketio==5.6.0
bidict==0.22.1
Django==4.2.1
gunicorn==20.1.0
h11==0.14.0
python-engineio==4.4.1
python-socketio==5.8.0
simple-websocket==0.10.0
sqlparse==0.4.4
wsproto==1.2.0

0 comments on commit 00b3166

Please sign in to comment.