Advertisement
Guest User

Untitled

a guest
Apr 14th, 2015
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. """
  2. WSGI config for psychomino project.
  3. It exposes the WSGI callable as a module-level variable named ``application``.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
  6. """
  7. import os
  8. import dotenv
  9.  
  10.  
  11. try:
  12.     dotenv.read_dotenv(
  13.         os.path.join(os.path.dirname(os.path.dirname(__file__)), '.env'))
  14. except Exception as e:
  15.     print(e)
  16.  
  17.  
  18. ENVIRONMENT = os.getenv('ENVIRONMENT')
  19.  
  20. if ENVIRONMENT == 'STAGING':
  21.     settings = 'staging'
  22. elif ENVIRONMENT == 'PRODUCTION':
  23.     settings = 'production'
  24. else:
  25.     settings = 'development'
  26.  
  27. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'psychomino.settings')
  28. os.environ.setdefault('DJANGO_CONFIGURATION', settings.title())
  29.  
  30. from django.core.wsgi import get_wsgi_application
  31. from whitenoise.django import DjangoWhiteNoise
  32.  
  33. application = get_wsgi_application()
  34. application = DjangoWhiteNoise(application)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement