Added asgi from newer model

This commit is contained in:
Adolfo Gómez García 2021-09-04 21:29:16 +02:00
parent 54f7fd21dc
commit df815776da
2 changed files with 21 additions and 23 deletions

16
server/src/server/asgi.py Normal file
View File

@ -0,0 +1,16 @@
"""
ASGI config for server project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
application = get_asgi_application()

View File

@ -1,34 +1,16 @@
""" """
WSGI config for server project. WSGI config for server project.
This module contains the WSGI application used by Django's development server It exposes the WSGI callable as a module-level variable named ``application``.
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
""" """
from django.core.wsgi import get_wsgi_application
import six
import os import os
if six.PY2: from django.core.wsgi import get_wsgi_application
import sys
# noinspection PyCompatibility os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
reload(sys)
sys.setdefaultencoding('UTF-8') # @UndefinedVariable
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
application = get_wsgi_application() application = get_wsgi_application()