mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-24 14:43:49 +03:00
updated local compose
This commit is contained in:
parent
30616ba17d
commit
1644fa5403
|
@ -4,8 +4,14 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
from akarpov.common.channels import HeaderAuthMiddleware
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
from config import routing
|
# 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()
|
||||||
|
|
||||||
|
|
||||||
|
from akarpov.common.channels import HeaderAuthMiddleware # noqa
|
||||||
|
from config import routing # noqa
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
|
@ -14,7 +20,7 @@
|
||||||
|
|
||||||
application = ProtocolTypeRouter(
|
application = ProtocolTypeRouter(
|
||||||
{
|
{
|
||||||
"http": get_asgi_application(),
|
"http": django_asgi_app,
|
||||||
"websocket": HeaderAuthMiddleware(URLRouter(routing.websocket_urlpatterns)),
|
"websocket": HeaderAuthMiddleware(URLRouter(routing.websocket_urlpatterns)),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user