mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 16:14:28 -04:00
add preliminary support for ASGI/daphne serving
This commit is contained in:
parent
26291f81ef
commit
2c48dabfab
2 changed files with 29 additions and 0 deletions
28
archivebox/core/asgi.py
Normal file
28
archivebox/core/asgi.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
"""
|
||||||
|
WSGI config for archivebox project.
|
||||||
|
|
||||||
|
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
|
For more information on this file, see
|
||||||
|
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from archivebox.config import setup_django
|
||||||
|
|
||||||
|
setup_django(in_memory_db=False, check_db=True)
|
||||||
|
|
||||||
|
|
||||||
|
from django.core.asgi import get_asgi_application
|
||||||
|
from channels.routing import ProtocolTypeRouter
|
||||||
|
|
||||||
|
|
||||||
|
django_asgi_app = get_asgi_application()
|
||||||
|
|
||||||
|
application = ProtocolTypeRouter(
|
||||||
|
{
|
||||||
|
"http": django_asgi_app,
|
||||||
|
# Just HTTP for now. (We can add other protocols later.)
|
||||||
|
}
|
||||||
|
)
|
|
@ -65,6 +65,7 @@ PLUGIN_KEYS = AttrDict({
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
WSGI_APPLICATION = 'core.wsgi.application'
|
WSGI_APPLICATION = 'core.wsgi.application'
|
||||||
|
ASGI_APPLICATION = "core.asgi.application"
|
||||||
ROOT_URLCONF = 'core.urls'
|
ROOT_URLCONF = 'core.urls'
|
||||||
|
|
||||||
LOGIN_URL = '/accounts/login/'
|
LOGIN_URL = '/accounts/login/'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue