12 lines
387 B
Python
12 lines
387 B
Python
from uvicorn.workers import UvicornWorker
|
|
|
|
|
|
class DjangoUvicornWorker(UvicornWorker):
|
|
"""Use UvicornWorker with lifespan='off', because Django does not
|
|
(and probably will not https://code.djangoproject.com/ticket/31508)
|
|
support Lifespan.
|
|
"""
|
|
|
|
def __init__(self, *args, **kwargs) -> None:
|
|
super().__init__(*args, **kwargs)
|
|
self.config.lifespan = "off"
|