diff --git a/Dockerfile b/Dockerfile index 9d8528c..9cdb8bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,8 @@ RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommend && pip install -v --timeout 120 --no-cache-dir ./requests-2.28.2-py3-none-any.whl \ && pip install -v --timeout 120 --no-cache-dir ./redis-4.4.2-py3-none-any.whl \ && pip install -v --timeout 120 --no-cache-dir ./graphene_django-3.0.0-py2.py3-none-any.whl \ + && pip install -v --timeout 120 --no-cache-dir ./channels-4.0.0.tar.gz \ + && pip install -v --timeout 120 --no-cache-dir ./daphne-4.0.0.tar.gz \ #&& pip install -v --timeout 120 -r requirements.txt --no-cache-dir \ && apt-get purge -y --auto-remove gcc g++\ && rm -rf /var/lib/apt/lists/* diff --git a/radarsys/asgi.py b/radarsys/asgi.py new file mode 100644 index 0000000..c4f0b49 --- /dev/null +++ b/radarsys/asgi.py @@ -0,0 +1,13 @@ +import os + +from channels.routing import ProtocolTypeRouter +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") + +application = ProtocolTypeRouter( + { + "http": get_asgi_application(), + # Just HTTP for now. (We can add other protocols later.) + } +) \ No newline at end of file diff --git a/radarsys/settings.py b/radarsys/settings.py index 0c81b50..95d4105 100644 --- a/radarsys/settings.py +++ b/radarsys/settings.py @@ -85,7 +85,7 @@ TEMPLATES = [ ] WSGI_APPLICATION = 'radarsys.wsgi.application' - +ASGI_APPLICATION = 'radarsys.asgi.application' # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases diff --git a/requirements.txt b/requirements.txt index 69f9a5f..31887ca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,5 @@ celery==5.2.7 gunicorn==20.1.0 requests==2.28.2 redis==4.4.2 +channels==4.0.0 +daphne==4.0.0