"""
Django settings for schema project.

Generated by 'django-admin startproject' using Django 3.0.4.

For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""

import os

try:
    import pymysql
    pymysql.install_as_MySQLdb()
except:
    pass

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '<KEY>

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'jobserver.apps.JobserverConfig',
]

MIDDLEWARE = [
]

ROOT_URLCONF = 'schema.urls'

TEMPLATES = [
]

WSGI_APPLICATION = 'schema.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

MYSQL_DATABASE = os.getenv('DATABASE_SCHEMA') or "jobserver"
MYSQL_HOST = os.getenv('DATABASE_HOST') or "localhost"
MYSQL_USER = os.getenv('DATABASE_USER') or "jobserver"
MYSQL_PASSWORD = os.getenv('DATABASE_PASSWORD') or "jobserver"

DATABASES = {
    'default': {
        'ENGINE': 'mysql.connector.django',
        'NAME': MYSQL_DATABASE,
        'HOST': MYSQL_HOST,
        'USER': MYSQL_USER,
        'PORT': 3306,
        'PASSWORD': <PASSWORD>,
        'OPTIONS': {
            'autocommit': True,
        },
    },
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

try:
    from .local import *
except:
    pass

"""
Django settings for schema project.

Generated by 'django-admin startproject' using Django 3.0.4.

For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""

import os

try:
    import pymysql
    pymysql.install_as_MySQLdb()
except:
    pass

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '<KEY>

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'jobserver.apps.JobserverConfig',
]

MIDDLEWARE = [
]

ROOT_URLCONF = 'schema.urls'

TEMPLATES = [
]

WSGI_APPLICATION = 'schema.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

MYSQL_DATABASE = os.getenv('DATABASE_SCHEMA') or "jobserver"
MYSQL_HOST = os.getenv('DATABASE_HOST') or "localhost"
MYSQL_USER = os.getenv('DATABASE_USER') or "jobserver"
MYSQL_PASSWORD = os.getenv('DATABASE_PASSWORD') or "jobserver"

DATABASES = {
    'default': {
        'ENGINE': 'mysql.connector.django',
        'NAME': MYSQL_DATABASE,
        'HOST': MYSQL_HOST,
        'USER': MYSQL_USER,
        'PORT': 3306,
        'PASSWORD': <PASSWORD>,
        'OPTIONS': {
            'autocommit': True,
        },
    },
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

try:
    from .local import *
except:
    pass

Django settings for schema project.  Generated by 'django-admin startproject' using Django 3.0.4.  For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/  For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: don't run with debug turned on in production! # Application definition # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/