Load development configs in asgi and wsgi
This commit is contained in:
parent
d7d3ef4c46
commit
72d55a5f14
2 changed files with 10 additions and 2 deletions
|
@ -8,9 +8,17 @@ https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
|
|||
"""
|
||||
|
||||
import os
|
||||
import dotenv
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmba_django.settings')
|
||||
dotenv.load_dotenv(
|
||||
os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env')
|
||||
)
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmba_django.settings.development')
|
||||
|
||||
if os.getenv('DJANGO_SETTINGS_MODULE'):
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = os.getenv('DJANGO_SETTINGS_MODULE')
|
||||
|
||||
application = get_asgi_application()
|
||||
|
|
|
@ -16,7 +16,7 @@ dotenv.load_dotenv(
|
|||
os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env')
|
||||
)
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmba_django.settings.develop')
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmba_django.settings.development')
|
||||
|
||||
if os.getenv('DJANGO_SETTINGS_MODULE'):
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = os.getenv('DJANGO_SETTINGS_MODULE')
|
||||
|
|
Loading…
Reference in a new issue