Linux archlinux 6.6.10-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 05 Jan 2024 16:20:18 +0000 x86_64 GNU/Linux
granian --interface asgi mysite.asgi:application --no-opt
[INFO] Starting granian
[INFO] Listening at: 127.0.0.1:8000
[INFO] Spawning worker-1 with pid: 27092
[WARNING] Exception in lifespan protocol
Traceback (most recent call last):
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/granian/asgi.py", line 24, in handle
await self.callable(
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 165, in __call__
raise ValueError(
ValueError: Django can only handle ASGI/HTTP connections, not lifespan.
[INFO] Started worker-1
[INFO] Started worker-1 runtime-1
[WARNING] Application callable raised an exception
Task exception was never retrieved
future: <Task finished name='Task-4' coro=<future_watcher_wrapper.<locals>.future_watcher() done, defined at /home/v/dev/django-workers/.venv/lib/python3.11/site-packages/granian/_futures.py:2> exception=AssertionError('Invalid ASGI message after request body: http.request')>
Traceback (most recent call last):
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/granian/_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 170, in __call__
await self.handle(scope, receive, send)
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 209, in handle
task.result()
File "/home/v/dev/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 232, in listen_for_disconnect
assert False, "Invalid ASGI message after request body: %s" % message["type"]
AssertionError: Invalid ASGI message after request body: http.request
"""
ASGI config for mysite 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/5.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
application = get_asgi_application()
app = application