mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
chore: use asgi rather than wsgi
By relying on Django Channels and Daphne. This requires a change in how the application is deployed to take that into account.
This commit is contained in:
parent
a2b8145cde
commit
71943c0ab3
3 changed files with 20 additions and 1 deletions
|
@ -28,6 +28,8 @@ classifiers = [
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"channels==4.0.0",
|
||||||
|
"daphne==4.1.0",
|
||||||
"Django==5.1.1",
|
"Django==5.1.1",
|
||||||
"django-agnocomplete==2.2.0",
|
"django-agnocomplete==2.2.0",
|
||||||
"django-environ==0.11.2",
|
"django-environ==0.11.2",
|
||||||
|
|
16
umap/asgi.py
Normal file
16
umap/asgi.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
from channels.routing import ProtocolTypeRouter
|
||||||
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umap.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()
|
||||||
|
|
||||||
|
application = ProtocolTypeRouter(
|
||||||
|
{
|
||||||
|
"http": django_asgi_app,
|
||||||
|
# Just HTTP for now. (We can add other protocols later.)
|
||||||
|
}
|
||||||
|
)
|
|
@ -19,7 +19,7 @@ env = environ.Env()
|
||||||
INTERNAL_IPS = env.list("INTERNAL_IPS", default=["127.0.0.1"])
|
INTERNAL_IPS = env.list("INTERNAL_IPS", default=["127.0.0.1"])
|
||||||
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
|
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
|
||||||
ADMINS = tuple(parseaddr(email) for email in env.list("ADMINS", default=[]))
|
ADMINS = tuple(parseaddr(email) for email in env.list("ADMINS", default=[]))
|
||||||
|
ASGI_APPLICATION = "umap.asgi.application"
|
||||||
|
|
||||||
DEBUG = env.bool("DEBUG", default=False)
|
DEBUG = env.bool("DEBUG", default=False)
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ LANGUAGES = (
|
||||||
SECRET_KEY = env("SECRET_KEY", default=None)
|
SECRET_KEY = env("SECRET_KEY", default=None)
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
|
"daphne",
|
||||||
"django.contrib.auth",
|
"django.contrib.auth",
|
||||||
"django.contrib.contenttypes",
|
"django.contrib.contenttypes",
|
||||||
"django.contrib.sessions",
|
"django.contrib.sessions",
|
||||||
|
|
Loading…
Reference in a new issue