Refactor Django project files to improve type hinting and code clarity
This commit is contained in:
parent
a37eea56a1
commit
11c3db9817
6 changed files with 80 additions and 94 deletions
|
|
@ -1,16 +1,13 @@
|
|||
"""
|
||||
ASGI config for config 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.2/howto/deployment/asgi/
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||
if TYPE_CHECKING:
|
||||
from django.core.handlers.asgi import ASGIHandler
|
||||
|
||||
application = get_asgi_application()
|
||||
os.environ.setdefault(key="DJANGO_SETTINGS_MODULE", value="config.settings")
|
||||
|
||||
application: ASGIHandler = get_asgi_application()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue