From 60012a766d78ddc10b38edc25f20fe61eedd458d Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Mon, 11 Feb 2019 11:09:23 -0200 Subject: [PATCH] config inicial --- requirements/requirements.txt | 1 + sapl/asgi.py | 14 ++++++++++++++ sapl/routing.py | 5 +++++ sapl/settings.py | 4 +++- setup.py | 8 ++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 sapl/asgi.py create mode 100644 sapl/routing.py diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6a101e223..023d80ced 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -15,6 +15,7 @@ django-extensions==2.1.4 django-image-cropping==1.2 django-webpack-loader==0.6.0 drf-yasg==1.13.0 +channels==2.1.7 easy-thumbnails==2.5 python-decouple==3.1 psycopg2-binary==2.7.6.1 diff --git a/sapl/asgi.py b/sapl/asgi.py new file mode 100644 index 000000000..3f9694f9f --- /dev/null +++ b/sapl/asgi.py @@ -0,0 +1,14 @@ +""" +ASGI entrypoint. Configures Django and then runs the application +defined in the ASGI_APPLICATION setting. +""" + +import os + +from channels.routing import get_default_application +import django + + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sapl.settings") +django.setup() +application = get_default_application() \ No newline at end of file diff --git a/sapl/routing.py b/sapl/routing.py new file mode 100644 index 000000000..7dcf4c575 --- /dev/null +++ b/sapl/routing.py @@ -0,0 +1,5 @@ +from channels.routing import ProtocolTypeRouter + +application = ProtocolTypeRouter({ + # Empty for now (http->django views is added by default) +}) \ No newline at end of file diff --git a/sapl/settings.py b/sapl/settings.py index 0faaf3416..74b31a6b6 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -100,6 +100,8 @@ INSTALLED_APPS = ( 'webpack_loader', + 'channels', + ) + SAPL_APPS # FTS = Full Text Search @@ -204,7 +206,7 @@ TEMPLATES = [ WSGI_APPLICATION = 'sapl.wsgi.application' - +ASGI_APPLICATION = "sapl.routing.application" # Database # https://docs.djangoproject.com/en/1.8/ref/settings/#databases diff --git a/setup.py b/setup.py index 45fb3734c..aca98d2b7 100644 --- a/setup.py +++ b/setup.py @@ -41,8 +41,16 @@ install_requires = [ 'pysolr==3.6.0', 'whoosh==2.7.4', + 'channels==2.1.7', + # 'git+git://github.com/interlegis/trml2pdf.git', +<<<<<<< HEAD + # 'git+git://github.com/interlegis/django-admin-bootstrapped', +======= + # 'git+git://github.com/jasperlittle/django-rest-framework-docs', # 'git+git://github.com/interlegis/django-admin-bootstrapped', + +>>>>>>> config inicial ] setup( name='interlegis-sapl',