chore: add serve command

This commit is contained in:
2026-06-12 01:43:42 +02:00
parent 216b2e1549
commit d7014f1cf8
4 changed files with 472 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
application = get_asgi_application()
+19
View File
@@ -0,0 +1,19 @@
import subprocess
import sys
from pathlib import Path
def serve() -> None:
"""Start the Daphne ASGI server on 0.0.0.0:8080."""
daphne_path = str(Path(sys.path[0]) / "daphne")
subprocess.run( # noqa: S603
[
daphne_path,
"-b",
"0.0.0.0", # noqa: S104
"-p",
"8080",
"app.routing:application",
],
check=True,
)