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:
@@ -2,6 +2,8 @@ asgiref==3.11.0
|
|||||||
attrs==25.4.0
|
attrs==25.4.0
|
||||||
certifi==2025.11.12
|
certifi==2025.11.12
|
||||||
cffi==2.0.0
|
cffi==2.0.0
|
||||||
|
channels
|
||||||
|
channels-redis
|
||||||
charset-normalizer==3.4.4
|
charset-normalizer==3.4.4
|
||||||
coverage
|
coverage
|
||||||
cssselect==1.3.0
|
cssselect==1.3.0
|
||||||
@@ -23,6 +25,7 @@ pycparser==2.23
|
|||||||
PySocks==1.7.1
|
PySocks==1.7.1
|
||||||
python-dotenv
|
python-dotenv
|
||||||
requests==2.32.5
|
requests==2.32.5
|
||||||
|
scipy
|
||||||
selenium==4.39.0
|
selenium==4.39.0
|
||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
sortedcontainers==2.4.0
|
sortedcontainers==2.4.0
|
||||||
@@ -34,6 +37,7 @@ types-PyYAML==6.0.12.20250915
|
|||||||
typing_extensions==4.15.0
|
typing_extensions==4.15.0
|
||||||
tzdata==2025.3
|
tzdata==2025.3
|
||||||
urllib3==2.6.2
|
urllib3==2.6.2
|
||||||
|
uvicorn[standard]
|
||||||
websocket-client==1.9.0
|
websocket-client==1.9.0
|
||||||
whitenoise==6.11.0
|
whitenoise==6.11.0
|
||||||
wsproto==1.3.2
|
wsproto==1.3.2
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
celery
|
celery
|
||||||
|
channels
|
||||||
|
channels-redis
|
||||||
cssselect==1.3.0
|
cssselect==1.3.0
|
||||||
Django==6.0
|
Django==6.0
|
||||||
dj-database-url
|
dj-database-url
|
||||||
@@ -13,5 +15,7 @@ lxml==6.0.2
|
|||||||
psycopg2-binary
|
psycopg2-binary
|
||||||
redis
|
redis
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
|
scipy
|
||||||
stripe
|
stripe
|
||||||
whitenoise==6.11.0
|
whitenoise==6.11.0
|
||||||
|
uvicorn[standard]
|
||||||
|
|||||||
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
|
import os
|
||||||
|
|
||||||
from django.core.asgi import get_asgi_application
|
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')
|
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',
|
'apps.gameboard',
|
||||||
# Gamer apps
|
# Gamer apps
|
||||||
'apps.lyric',
|
'apps.lyric',
|
||||||
|
'apps.epic',
|
||||||
# Custom apps
|
# Custom apps
|
||||||
'apps.api',
|
'apps.api',
|
||||||
'apps.applets',
|
'apps.applets',
|
||||||
'functional_tests',
|
'functional_tests',
|
||||||
# Depend apps
|
# Depend apps
|
||||||
|
'channels',
|
||||||
'compressor',
|
'compressor',
|
||||||
'rest_framework',
|
'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')
|
CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://localhost:6379/0')
|
||||||
REDIS_URL = os.environ.get('REDIS_URL')
|
REDIS_URL = os.environ.get('REDIS_URL')
|
||||||
if REDIS_URL:
|
if REDIS_URL:
|
||||||
@@ -130,6 +132,14 @@ if REDIS_URL:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
|
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
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
|
||||||
|
|||||||
Reference in New Issue
Block a user