Script pane, realtime peer sync, and logout button
- Script pane: PDF tab beside annotations; "Add script annotation" arms highlight mode on the draft, ✓/✕ to confirm/cancel, auto-scrolls to the active annotation's highlights during playback. Adds Project.script. - Realtime: Django Channels websocket per project broadcasts attributed scene deltas after each save; peers merge them in (keeping local drafts). - Logout link in the editor project-bar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
595ac5ba72
commit
d3c8dcbdf2
13 changed files with 307 additions and 11 deletions
|
|
@ -1,10 +1,8 @@
|
|||
"""
|
||||
ASGI config for server 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/
|
||||
HTTP is handled by Django as usual; websocket connections are routed to the
|
||||
scene consumers so peers receive live scene deltas.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
|
@ -13,4 +11,15 @@ from django.core.asgi import get_asgi_application
|
|||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
# Initialise Django before importing anything that touches the app registry.
|
||||
django_asgi_app = get_asgi_application()
|
||||
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
|
||||
import scenes.routing
|
||||
|
||||
application = ProtocolTypeRouter({
|
||||
'http': django_asgi_app,
|
||||
'websocket': AuthMiddlewareStack(URLRouter(scenes.routing.websocket_urlpatterns)),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'testserver']
|
|||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'daphne', # ASGI server; must precede staticfiles so runserver uses it
|
||||
'channels',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
|
|
@ -54,6 +56,11 @@ MIDDLEWARE = [
|
|||
|
||||
ROOT_URLCONF = 'server.urls'
|
||||
|
||||
# Realtime: push scene deltas to peers over websockets. In-memory layer is fine
|
||||
# for a single process; swap to channels_redis when you run more than one worker.
|
||||
ASGI_APPLICATION = 'server.asgi.application'
|
||||
CHANNEL_LAYERS = {'default': {'BACKEND': 'channels.layers.InMemoryChannelLayer'}}
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue