Une interface REST partielle pour Noethys
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

45 lines
1.7 KiB

"""
Production settings.
- validate the configuration
- load secret key from environment variables
- set other production configurations
"""
from django.core.exceptions import ImproperlyConfigured
from .base import * # noqa
# CONFIGURATION VALIDATION
# ------------------------------------------------------------------------------
# Ensure that the database configuration has been set
if not env('DJANGO_DATABASE_URL', default=None):
raise ImproperlyConfigured(
"No database configuration has been set, you should check "
"the value of your DATABASE_URL environment variable."
)
# Ensure that the default email address has been set
if not env('DEFAULT_FROM_EMAIL', default=None):
raise ImproperlyConfigured(
"No default email address has been set, you should check "
"the value of your DEFAULT_FROM_EMAIL environment variable."
)
# Always disable debug mode in production
DEBUG = False
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
SECRET_KEY = env('DJANGO_SECRET_KEY')
# SITE CONFIGURATION
# ------------------------------------------------------------------------------
# Hosts/domain names that are valid for this site
# @link https://docs.djangoproject.com/en/2.0/ref/settings/#allowed-hosts
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=[])
# ------------------------------------------------------------------------------
# APPLICATION AND 3RD PARTY LIBRARY SETTINGS
# ------------------------------------------------------------------------------
Map all the world