# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

import os

# Project Hierarchy:
# ez_heroku_django          <==== BASE_DIR
#     |----> django_project <==== django_project_name
#     |----> django_app_1
#     |----> django_app_2
#     |----> ...
#     |----> staticfiles    (ignored by git, only needed by heroku)
#                |----> dev_local_environment.txt (Indicator of dev env, generated by "controller.sh -o build")

settings_py_path = os.path.abspath(__file__)                 # ~/ez_beauty/ez_beauty/settings.py
django_project_path = os.path.dirname(settings_py_path)      # ~/ez_beauty/ez_beauty/
django_project_name = os.path.basename(django_project_path)  # ez_beauty
BASE_DIR = os.path.dirname(django_project_path)              # ~/ez_beauty/
ROOT_URLCONF = f"{django_project_name}.urls"
WSGI_APPLICATION = f"{django_project_name}.wsgi.application"
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")          # ~/ez_beauty/staticfiles (will be ignored by git)
dev_local_environment=os.path.join(STATIC_ROOT, "dev_local_environment.txt")
# Static files (CSS, JavaScript, Images) https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = "/static/"

DATABASES = {}

MIDDLEWARE = [
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "django.middleware.security.SecurityMiddleware",
    # Simplified static file serving: https://warehouse.python.org/project/whitenoise/
    "whitenoise.middleware.WhiteNoiseMiddleware"
]

# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = "en-us"
USE_TZ = True
USE_I18N = True
USE_L10N = True
TIME_ZONE = ""

if os.path.exists(dev_local_environment):
    # Dev Environment !!!!!
    DEBUG = True
    ALLOWED_HOSTS = []
    SECRET_KEY = f"{django_project_name}_secret_key"
    DATABASES["default"] = {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(STATIC_ROOT, "db.sqlite3"),}
    # # heroku uses postgresql, to test the production database use the following DB settings
    # DATABASES["default"] = {"ENGINE": "django.db.backends.postgresql", "NAME": f"{django_project_name}_db", "PORT": "5432",}
    # "controller.sh -o config" will write local dev timezone to "dev_local_environment.txt"
    with open(dev_local_environment, "r") as file_handler:
        TIME_ZONE = file_handler.read().strip()
else:
    # Production Environment !!!!!
    # SECURITY WARNING: keep the secret key used in production secret!
    # heroku config:set SECRET_KEY=${KEY_VALUE}
    # SECRET_KEY = ""
    # SECURITY WARNING: don't run with debug turned on in production!
    DEBUG = False
    # SECURITY WARNING: only allow the web host vendor's domain
    ALLOWED_HOSTS = [".herokuapp.com"]
    # https://devcenter.heroku.com/articles/django-assets
    # Run "heroku config:set DISABLE_COLLECTSTATIC=1" to disable collectstatic
    STATICFILES_DIRS = (STATIC_ROOT,)
    STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
    # Honor the 'X-Forwarded-Proto' header for request.is_secure()
    SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
    # Heroku will take of the timezone (django_heroku.settings(locals()))
    TIME_ZONE = "UTC"
    import django_heroku
    django_heroku.settings(locals())

# Application definition
PROJECT_APPS = [
    "phonenumber_field",
    # (pip install django-bootstrap4)
    "bootstrap4",
    # https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/# (pip install django-bootstrap-datepicker-plus)
    "bootstrap_datepicker_plus",
    # Django admin page datetime range filter (pip install django-admin-rangefilter)
    # https://github.com/silentsokolov/django-admin-rangefilter
    "rangefilter",
    # Content-Security-Policy used by datetime range filter (pip install django-csp)
    "csp",
    "django_app_1.apps.DjangoApp1Config",
]

# For Phone Number Field
PHONENUMBER_DEFAULT_REGION="US"

# Bootstrap 4
# https://django-bootstrap4.readthedocs.io/en/latest/settings.html
BOOTSTRAP4 = {
    # Enable jquery for bootstrap_datepicker_plus
    "include_jquery": True,
    # Set placeholder attributes to label if no placeholder is provided
    "set_placeholder": True,
}

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
] + PROJECT_APPS

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",},
    {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},
    {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},
    {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
]

c3c6de079b577cb8c0ca9b398a7a0c8ec8b5a1be
<mask token>

<mask token>
if os.path.exists(dev_local_environment):
    DEBUG = True
    ALLOWED_HOSTS = []
    SECRET_KEY = f'{django_project_name}_secret_key'
    DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3', 'NAME':
        os.path.join(STATIC_ROOT, 'db.sqlite3')}
    with open(dev_local_environment, 'r') as file_handler:
        TIME_ZONE = file_handler.read().strip()
else:
    DEBUG = False
    ALLOWED_HOSTS = ['.herokuapp.com']
    STATICFILES_DIRS = STATIC_ROOT,
    STATICFILES_STORAGE = (
        'whitenoise.storage.CompressedManifestStaticFilesStorage')
    SECURE_PROXY_SSL_HEADER = 'HTTP_X_FORWARDED_PROTO', 'https'
    TIME_ZONE = 'UTC'
    import django_heroku
    django_heroku.settings(locals())
<mask token>

<mask token>
settings_py_path = os.path.abspath(__file__)
django_project_path = os.path.dirname(settings_py_path)
django_project_name = os.path.basename(django_project_path)
BASE_DIR = os.path.dirname(django_project_path)
ROOT_URLCONF = f'{django_project_name}.urls'
WSGI_APPLICATION = f'{django_project_name}.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
dev_local_environment = os.path.join(STATIC_ROOT, 'dev_local_environment.txt')
STATIC_URL = '/static/'
DATABASES = {}
MIDDLEWARE = ['django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware']
LANGUAGE_CODE = 'en-us'
USE_TZ = True
USE_I18N = True
USE_L10N = True
TIME_ZONE = ''
if os.path.exists(dev_local_environment):
    DEBUG = True
    ALLOWED_HOSTS = []
    SECRET_KEY = f'{django_project_name}_secret_key'
    DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3', 'NAME':
        os.path.join(STATIC_ROOT, 'db.sqlite3')}
    with open(dev_local_environment, 'r') as file_handler:
        TIME_ZONE = file_handler.read().strip()
else:
    DEBUG = False
    ALLOWED_HOSTS = ['.herokuapp.com']
    STATICFILES_DIRS = STATIC_ROOT,
    STATICFILES_STORAGE = (
        'whitenoise.storage.CompressedManifestStaticFilesStorage')
    SECURE_PROXY_SSL_HEADER = 'HTTP_X_FORWARDED_PROTO', 'https'
    TIME_ZONE = 'UTC'
    import django_heroku
    django_heroku.settings(locals())
PROJECT_APPS = ['phonenumber_field', 'bootstrap4',
    'bootstrap_datepicker_plus', 'rangefilter', 'csp',
    'django_app_1.apps.DjangoApp1Config']
PHONENUMBER_DEFAULT_REGION = 'US'
BOOTSTRAP4 = {'include_jquery': True, 'set_placeholder': True}
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles'] + PROJECT_APPS
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages']}}]
AUTH_PASSWORD_VALIDATORS = [{'NAME':
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
    }, {'NAME':
    'django.contrib.auth.password_validation.MinimumLengthValidator'}, {
    'NAME':
    'django.contrib.auth.password_validation.CommonPasswordValidator'}, {
    'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}
    ]

import os
settings_py_path = os.path.abspath(__file__)
django_project_path = os.path.dirname(settings_py_path)
django_project_name = os.path.basename(django_project_path)
BASE_DIR = os.path.dirname(django_project_path)
ROOT_URLCONF = f'{django_project_name}.urls'
WSGI_APPLICATION = f'{django_project_name}.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
dev_local_environment = os.path.join(STATIC_ROOT, 'dev_local_environment.txt')
STATIC_URL = '/static/'
DATABASES = {}
MIDDLEWARE = ['django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware']
LANGUAGE_CODE = 'en-us'
USE_TZ = True
USE_I18N = True
USE_L10N = True
TIME_ZONE = ''
if os.path.exists(dev_local_environment):
    DEBUG = True
    ALLOWED_HOSTS = []
    SECRET_KEY = f'{django_project_name}_secret_key'
    DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3', 'NAME':
        os.path.join(STATIC_ROOT, 'db.sqlite3')}
    with open(dev_local_environment, 'r') as file_handler:
        TIME_ZONE = file_handler.read().strip()
else:
    DEBUG = False
    ALLOWED_HOSTS = ['.herokuapp.com']
    STATICFILES_DIRS = STATIC_ROOT,
    STATICFILES_STORAGE = (
        'whitenoise.storage.CompressedManifestStaticFilesStorage')
    SECURE_PROXY_SSL_HEADER = 'HTTP_X_FORWARDED_PROTO', 'https'
    TIME_ZONE = 'UTC'
    import django_heroku
    django_heroku.settings(locals())
PROJECT_APPS = ['phonenumber_field', 'bootstrap4',
    'bootstrap_datepicker_plus', 'rangefilter', 'csp',
    'django_app_1.apps.DjangoApp1Config']
PHONENUMBER_DEFAULT_REGION = 'US'
BOOTSTRAP4 = {'include_jquery': True, 'set_placeholder': True}
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles'] + PROJECT_APPS
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages']}}]
AUTH_PASSWORD_VALIDATORS = [{'NAME':
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
    }, {'NAME':
    'django.contrib.auth.password_validation.MinimumLengthValidator'}, {
    'NAME':
    'django.contrib.auth.password_validation.CommonPasswordValidator'}, {
    'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}
    ]

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

import os

# Project Hierarchy:
# ez_heroku_django          <==== BASE_DIR
#     |----> django_project <==== django_project_name
#     |----> django_app_1
#     |----> django_app_2
#     |----> ...
#     |----> staticfiles    (ignored by git, only needed by heroku)
#                |----> dev_local_environment.txt (Indicator of dev env, generated by "controller.sh -o build")

settings_py_path = os.path.abspath(__file__)                 # ~/ez_beauty/ez_beauty/settings.py
django_project_path = os.path.dirname(settings_py_path)      # ~/ez_beauty/ez_beauty/
django_project_name = os.path.basename(django_project_path)  # ez_beauty
BASE_DIR = os.path.dirname(django_project_path)              # ~/ez_beauty/
ROOT_URLCONF = f"{django_project_name}.urls"
WSGI_APPLICATION = f"{django_project_name}.wsgi.application"
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")          # ~/ez_beauty/staticfiles (will be ignored by git)
dev_local_environment=os.path.join(STATIC_ROOT, "dev_local_environment.txt")
# Static files (CSS, JavaScript, Images) https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = "/static/"

DATABASES = {}

MIDDLEWARE = [
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
    "django.middleware.security.SecurityMiddleware",
    # Simplified static file serving: https://warehouse.python.org/project/whitenoise/
    "whitenoise.middleware.WhiteNoiseMiddleware"
]

# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = "en-us"
USE_TZ = True
USE_I18N = True
USE_L10N = True
TIME_ZONE = ""

if os.path.exists(dev_local_environment):
    # Dev Environment !!!!!
    DEBUG = True
    ALLOWED_HOSTS = []
    SECRET_KEY = f"{django_project_name}_secret_key"
    DATABASES["default"] = {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(STATIC_ROOT, "db.sqlite3"),}
    # # heroku uses postgresql, to test the production database use the following DB settings
    # DATABASES["default"] = {"ENGINE": "django.db.backends.postgresql", "NAME": f"{django_project_name}_db", "PORT": "5432",}
    # "controller.sh -o config" will write local dev timezone to "dev_local_environment.txt"
    with open(dev_local_environment, "r") as file_handler:
        TIME_ZONE = file_handler.read().strip()
else:
    # Production Environment !!!!!
    # SECURITY WARNING: keep the secret key used in production secret!
    # heroku config:set SECRET_KEY=${KEY_VALUE}
    # SECRET_KEY = ""
    # SECURITY WARNING: don't run with debug turned on in production!
    DEBUG = False
    # SECURITY WARNING: only allow the web host vendor's domain
    ALLOWED_HOSTS = [".herokuapp.com"]
    # https://devcenter.heroku.com/articles/django-assets
    # Run "heroku config:set DISABLE_COLLECTSTATIC=1" to disable collectstatic
    STATICFILES_DIRS = (STATIC_ROOT,)
    STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
    # Honor the 'X-Forwarded-Proto' header for request.is_secure()
    SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
    # Heroku will take of the timezone (django_heroku.settings(locals()))
    TIME_ZONE = "UTC"
    import django_heroku
    django_heroku.settings(locals())

# Application definition
PROJECT_APPS = [
    "phonenumber_field",
    # (pip install django-bootstrap4)
    "bootstrap4",
    # https://django-bootstrap-datepicker-plus.readthedocs.io/en/latest/# (pip install django-bootstrap-datepicker-plus)
    "bootstrap_datepicker_plus",
    # Django admin page datetime range filter (pip install django-admin-rangefilter)
    # https://github.com/silentsokolov/django-admin-rangefilter
    "rangefilter",
    # Content-Security-Policy used by datetime range filter (pip install django-csp)
    "csp",
    "django_app_1.apps.DjangoApp1Config",
]

# For Phone Number Field
PHONENUMBER_DEFAULT_REGION="US"

# Bootstrap 4
# https://django-bootstrap4.readthedocs.io/en/latest/settings.html
BOOTSTRAP4 = {
    # Enable jquery for bootstrap_datepicker_plus
    "include_jquery": True,
    # Set placeholder attributes to label if no placeholder is provided
    "set_placeholder": True,
}

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
] + PROJECT_APPS

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",},
    {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},
    {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},
    {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
]
