Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/daphne #400

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django_app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY django_app/ .
COPY --from=npm-packages /src/node_modules/ frontend/node_modules/
COPY --from=poetry-packages /src/venv ./venv

ENV DJANGO_SETTINGS_MODULE='redbox_app.settings.py'
ENV DJANGO_SETTINGS_MODULE='redbox_app.settings'
ENV PYTHONPATH "${PYTHONPATH}:/."

EXPOSE 8090
Expand Down
119 changes: 49 additions & 70 deletions django_app/poetry.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion django_app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ django-allauth = "^0.61.1"
humanize = "^4.9.0"
channels = {extras = ["daphne"], version = "^4.1.0"}
django-gov-notify = "^0.5.0"
gunicorn = "^22.0.0"
websockets = "^12.0"

[tool.poetry.group.dev.dependencies]
Expand Down
8 changes: 6 additions & 2 deletions django_app/redbox_app/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application

from .routing import websocket_urlpatterns

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "redbox_app.settings")
# Initialize Django ASGI application early to ensure the AppRegistry
# is populated before importing code that may import ORM models.
django_asgi_app = get_asgi_application()

# https://github.com/django/daphne/issues/347#issuecomment-733132711
from redbox_app.routing import websocket_urlpatterns # noqa: E402

application = ProtocolTypeRouter(
{
Expand Down
4 changes: 0 additions & 4 deletions django_app/redbox_app/gunicorn.py

This file was deleted.

2 changes: 1 addition & 1 deletion django_app/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ venv/bin/django-admin collectstatic --noinput
venv/bin/django-admin compress --force --engine jinja2
venv/bin/django-admin create_admin_user

exec venv/bin/gunicorn -c ./redbox_app/gunicorn.py redbox_app.wsgi
exec venv/bin/daphne -p 8090 redbox_app.asgi:application
119 changes: 60 additions & 59 deletions poetry.lock

Large diffs are not rendered by default.

Loading