seeded apps.epic for backend gameboard logic; core.asgi & .settings now accomodate Channels via Redis; several new libraries in reqs to accomodate
This commit is contained in:
0
src/apps/epic/__init__.py
Normal file
0
src/apps/epic/__init__.py
Normal file
3
src/apps/epic/admin.py
Normal file
3
src/apps/epic/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
src/apps/epic/apps.py
Normal file
5
src/apps/epic/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EpicConfig(AppConfig):
|
||||
name = 'apps.epic'
|
||||
1
src/apps/epic/consumers.py
Normal file
1
src/apps/epic/consumers.py
Normal file
@@ -0,0 +1 @@
|
||||
# RoomConsumer goes here
|
||||
0
src/apps/epic/forms.py
Normal file
0
src/apps/epic/forms.py
Normal file
0
src/apps/epic/migrations/__init__.py
Normal file
0
src/apps/epic/migrations/__init__.py
Normal file
3
src/apps/epic/models.py
Normal file
3
src/apps/epic/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
1
src/apps/epic/routing.py
Normal file
1
src/apps/epic/routing.py
Normal file
@@ -0,0 +1 @@
|
||||
websocket_urlpatterns = []
|
||||
0
src/apps/epic/tests/__init__.py
Normal file
0
src/apps/epic/tests/__init__.py
Normal file
0
src/apps/epic/tests/integrated/__init__.py
Normal file
0
src/apps/epic/tests/integrated/__init__.py
Normal file
0
src/apps/epic/tests/unit/__init__.py
Normal file
0
src/apps/epic/tests/unit/__init__.py
Normal file
0
src/apps/epic/urls.py
Normal file
0
src/apps/epic/urls.py
Normal file
3
src/apps/epic/views.py
Normal file
3
src/apps/epic/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
1
src/apps/epic/voronoi.py
Normal file
1
src/apps/epic/voronoi.py
Normal file
@@ -0,0 +1 @@
|
||||
# TODO: toroidal topology (tile seeds across boundary before computing)
|
||||
@@ -1,16 +1,19 @@
|
||||
"""
|
||||
ASGI config for core 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/6.0/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
|
||||
import apps.epic.routing
|
||||
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
application = ProtocolTypeRouter({
|
||||
'http': get_asgi_application(),
|
||||
'websocket': AuthMiddlewareStack(
|
||||
URLRouter(
|
||||
apps.epic.routing.websocket_urlpatterns
|
||||
)
|
||||
),
|
||||
})
|
||||
|
||||
@@ -59,11 +59,13 @@ INSTALLED_APPS = [
|
||||
'apps.gameboard',
|
||||
# Gamer apps
|
||||
'apps.lyric',
|
||||
'apps.epic',
|
||||
# Custom apps
|
||||
'apps.api',
|
||||
'apps.applets',
|
||||
'functional_tests',
|
||||
# Depend apps
|
||||
'channels',
|
||||
'compressor',
|
||||
'rest_framework',
|
||||
]
|
||||
@@ -119,7 +121,7 @@ else:
|
||||
}
|
||||
}
|
||||
|
||||
# Celery & Redis
|
||||
# Celery & Redis & Channels (oh my)
|
||||
CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379/0')
|
||||
REDIS_URL = os.environ.get('REDIS_URL')
|
||||
if REDIS_URL:
|
||||
@@ -130,6 +132,14 @@ if REDIS_URL:
|
||||
}
|
||||
}
|
||||
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
|
||||
CHANNEL_LAYERS = {
|
||||
'default': {
|
||||
'BACKEND': 'channels_redis.core.RedisChannelLayer',
|
||||
'CONFIG': {
|
||||
'hosts': [os.environ.get('REDIS_URL', 'redis://localhost:6379/1')],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
|
||||
|
||||
Reference in New Issue
Block a user