Load development configs in asgi and wsgi

This commit is contained in:
PCoder 2021-07-27 09:52:27 +05:30
parent d7d3ef4c46
commit 72d55a5f14
2 changed files with 10 additions and 2 deletions

View file

@ -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()

View file

@ -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')