Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from django.core.wsgi import get_wsgi_application
- import json
- from django.core.exceptions import ImproperlyConfigured
- with open("global_data.json") as f:
- value = json.loads(f.read())
- def get_value(value_title, values=value):
- try:
- return values[value_title]
- except:
- msg = f"The name of {value_title} doesn't exists"
- raise ImproperlyConfigured(msg)
- if get_value("ENVIRONMENT") == "local":
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', f'{get_value("CORE_APP")}.settings.local')
- else:
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', f'{get_value("CORE_APP")}.settings.production')
- application = get_wsgi_application()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement