Bump Channels and Daphne to 4.0

This commit is contained in:
Reckless_Satoshi 2023-05-01 09:19:15 -07:00
parent 72976ab46b
commit f6f6a9244c
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 17 additions and 5 deletions

View File

@ -6,8 +6,8 @@ django-model-utils==4.3.1
django-redis==5.2.0
django-timezone-field==5.0
djangorestframework==3.14.0
channels==3.0.4
channels-redis==3.3.1
channels==4.0.0
channels-redis==4.1.0
celery==5.2.7
grpcio==1.54.0
googleapis-common-protos==1.59.0
@ -25,10 +25,10 @@ SQLAlchemy==2.0.12
django-import-export==3.2.0
requests[socks]
python-gnupg==0.5.0
daphne==3.0.2
daphne==4.0.0
drf-spectacular==0.26.2
drf-spectacular-sidecar==2023.4.1
black==23.3.0
black==22.8.0
isort==5.12.0
flake8==6.0.0
pyflakes==3.0.1

View File

@ -1,10 +1,19 @@
import os
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
import chat.routing
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "robosats.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,
"websocket": AuthMiddlewareStack(
URLRouter(
chat.routing.websocket_urlpatterns,

View File

@ -49,9 +49,11 @@ ALLOWED_HOSTS = [
config("I2P_LONG"),
config("LOCAL_ALIAS"),
"127.0.0.1",
"localhost",
]
CORS_ALLOW_ALL_ORIGINS = True
CSRF_TRUSTED_ORIGINS = ["http://*", "https://*"]
# Allows Session Cookie to be read by Javascript on Client side.
SESSION_COOKIE_HTTPONLY = False
@ -81,15 +83,16 @@ if os.environ.get("LOG_TO_CONSOLE"):
# Application definition
INSTALLED_APPS = [
"daphne",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"channels",
"django.contrib.staticfiles",
"corsheaders",
"rest_framework",
"channels",
"django_celery_beat",
"django_celery_results",
"import_export",