"""
Django settings for mysite project.

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

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

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


import os
import django.contrib.auth
django.contrib.auth.LOGIN_URL = '/'


# 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/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xnw^-qf5hc_&^evh$*3igr9i#i31v5h-hfwn#014n8s011)x*g'


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

# ALLOWED_HOSTS = ['classscanner.herokuapp', '127.0.0.1', '0.0.0.0']
ALLOWED_HOSTS = ['*']

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')


# Application definition
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    #my apps
    'scanner',
    #3rd party apps
    'django_celery_results',
    'django_celery_beat',
    'phonenumber_field',
]

PHONENUMBER_DB_FORMAT = 'E164'


# import djcelery
# djcelery.setup_loader()



# DEVELOPEMENT

# BROKER_URL = 'amqp://guest:guest@localhost:5672/'
# CELERY_RESULT_BACKEND = 'django-db'
# # CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
# # CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'

# CELERY_ACCEPT_CONTENT = ['json']
# CELERY_TASK_SERIALIZER = 'json'
# CELERY_RESULT_SERIALIZER = 'json'



# PRODUCTION

CLOUDAMQP_URL = "amqp://skleicus:43L_q0Y8ReOHuB120dBXohFf7KaH2TOQ@salamander.rmq.cloudamqp.com/skleicus"
# BROKER_URL = os.environ.get('CLOUDAMQP_URL', "django://")
BROKER_URL = CLOUDAMQP_URL
BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_MAX_RETRIES = None

CELERY_TASK_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ["json", "msgpack"]
# CELERY_RESULT_BACKEND = 'None'
CELERY_RESULT_BACKEND = 'rpc'


# if BROKER_URL == "django://":
#     INSTALLED_APPS += ("kombu.transport.django",)





MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    #custom middleware   
]

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [   os.path.join(BASE_DIR, 'templates'),

                ],
        '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',
            ],
        },
    },
]

WSGI_APPLICATION = 'mysite.wsgi.application'


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


# DEVLOPMENT

# DATABASES = {
# 'default': {
#     'ENGINE': 'django.db.backends.mysql',
#     'NAME': 'ClassScanner',
#     'HOST': '127.0.0.1',
#     'PORT': '3306',
#     'USER': 'root',
#     'PASSWORD': '',
# }}


# PRODUCTION
# "mysql://b348183391de7f:9ce1b0e6@us-cdbr-iron-east-04.cleardb.net/heroku_11a6f5714d6fc32?reconnect=true"
DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'heroku_11a6f5714d6fc32',
    'HOST': 'us-cdbr-iron-east-04.cleardb.net',
    'USER': 'b348183391de7f',
    'PASSWORD': '9ce1b0e6',
}}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
    },
]

AUTH_USER_MODEL = 'scanner.CustomUser'


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

LANGUAGE_CODE = 'en-us'

# TIME_ZONE = 'America/Los_Angeles'
TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True




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

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
    ('css', os.path.join(STATIC_ROOT, 'css')),
    ('js', os.path.join(STATIC_ROOT, 'js')),
    ('images', os.path.join(STATIC_ROOT, 'images')),

)



b61c51151d7f87d6fe92173bcaf80fd118c89968
<mask token>

<mask token>
django.contrib.auth.LOGIN_URL = '/'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'xnw^-qf5hc_&^evh$*3igr9i#i31v5h-hfwn#014n8s011)x*g'
DEBUG = False
ALLOWED_HOSTS = ['*']
SECURE_PROXY_SSL_HEADER = 'HTTP_X_FORWARDED_PROTO', 'https'
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'scanner',
    'django_celery_results', 'django_celery_beat', 'phonenumber_field']
PHONENUMBER_DB_FORMAT = 'E164'
CLOUDAMQP_URL = (
    'amqp://skleicus:43L_q0Y8ReOHuB120dBXohFf7KaH2TOQ@salamander.rmq.cloudamqp.com/skleicus'
    )
BROKER_URL = CLOUDAMQP_URL
BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_MAX_RETRIES = None
CELERY_TASK_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json', 'msgpack']
CELERY_RESULT_BACKEND = 'rpc'
MIDDLEWARE_CLASSES = ['django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware']
ROOT_URLCONF = 'mysite.urls'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')], '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']}}]
WSGI_APPLICATION = 'mysite.wsgi.application'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'heroku_11a6f5714d6fc32', 'HOST': 'us-cdbr-iron-east-04.cleardb.net',
    'USER': 'b348183391de7f', 'PASSWORD': '9ce1b0e6'}}
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'}
    ]
AUTH_USER_MODEL = 'scanner.CustomUser'
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = ('css', os.path.join(STATIC_ROOT, 'css')), ('js', os.
    path.join(STATIC_ROOT, 'js')), ('images', os.path.join(STATIC_ROOT,
    'images'))

<mask token>
import os
import django.contrib.auth
django.contrib.auth.LOGIN_URL = '/'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'xnw^-qf5hc_&^evh$*3igr9i#i31v5h-hfwn#014n8s011)x*g'
DEBUG = False
ALLOWED_HOSTS = ['*']
SECURE_PROXY_SSL_HEADER = 'HTTP_X_FORWARDED_PROTO', 'https'
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'scanner',
    'django_celery_results', 'django_celery_beat', 'phonenumber_field']
PHONENUMBER_DB_FORMAT = 'E164'
CLOUDAMQP_URL = (
    'amqp://skleicus:43L_q0Y8ReOHuB120dBXohFf7KaH2TOQ@salamander.rmq.cloudamqp.com/skleicus'
    )
BROKER_URL = CLOUDAMQP_URL
BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_MAX_RETRIES = None
CELERY_TASK_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json', 'msgpack']
CELERY_RESULT_BACKEND = 'rpc'
MIDDLEWARE_CLASSES = ['django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware']
ROOT_URLCONF = 'mysite.urls'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates')], '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']}}]
WSGI_APPLICATION = 'mysite.wsgi.application'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'heroku_11a6f5714d6fc32', 'HOST': 'us-cdbr-iron-east-04.cleardb.net',
    'USER': 'b348183391de7f', 'PASSWORD': '9ce1b0e6'}}
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'}
    ]
AUTH_USER_MODEL = 'scanner.CustomUser'
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = ('css', os.path.join(STATIC_ROOT, 'css')), ('js', os.
    path.join(STATIC_ROOT, 'js')), ('images', os.path.join(STATIC_ROOT,
    'images'))

"""
Django settings for mysite project.

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

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

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


import os
import django.contrib.auth
django.contrib.auth.LOGIN_URL = '/'


# 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/1.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xnw^-qf5hc_&^evh$*3igr9i#i31v5h-hfwn#014n8s011)x*g'


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

# ALLOWED_HOSTS = ['classscanner.herokuapp', '127.0.0.1', '0.0.0.0']
ALLOWED_HOSTS = ['*']

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')


# Application definition
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    #my apps
    'scanner',
    #3rd party apps
    'django_celery_results',
    'django_celery_beat',
    'phonenumber_field',
]

PHONENUMBER_DB_FORMAT = 'E164'


# import djcelery
# djcelery.setup_loader()



# DEVELOPEMENT

# BROKER_URL = 'amqp://guest:guest@localhost:5672/'
# CELERY_RESULT_BACKEND = 'django-db'
# # CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
# # CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'

# CELERY_ACCEPT_CONTENT = ['json']
# CELERY_TASK_SERIALIZER = 'json'
# CELERY_RESULT_SERIALIZER = 'json'



# PRODUCTION

CLOUDAMQP_URL = "amqp://skleicus:43L_q0Y8ReOHuB120dBXohFf7KaH2TOQ@salamander.rmq.cloudamqp.com/skleicus"
# BROKER_URL = os.environ.get('CLOUDAMQP_URL', "django://")
BROKER_URL = CLOUDAMQP_URL
BROKER_POOL_LIMIT = 0
BROKER_CONNECTION_MAX_RETRIES = None

CELERY_TASK_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ["json", "msgpack"]
# CELERY_RESULT_BACKEND = 'None'
CELERY_RESULT_BACKEND = 'rpc'


# if BROKER_URL == "django://":
#     INSTALLED_APPS += ("kombu.transport.django",)





MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    #custom middleware   
]

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [   os.path.join(BASE_DIR, 'templates'),

                ],
        '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',
            ],
        },
    },
]

WSGI_APPLICATION = 'mysite.wsgi.application'


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


# DEVLOPMENT

# DATABASES = {
# 'default': {
#     'ENGINE': 'django.db.backends.mysql',
#     'NAME': 'ClassScanner',
#     'HOST': '127.0.0.1',
#     'PORT': '3306',
#     'USER': 'root',
#     'PASSWORD': '',
# }}


# PRODUCTION
# "mysql://b348183391de7f:9ce1b0e6@us-cdbr-iron-east-04.cleardb.net/heroku_11a6f5714d6fc32?reconnect=true"
DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'heroku_11a6f5714d6fc32',
    'HOST': 'us-cdbr-iron-east-04.cleardb.net',
    'USER': 'b348183391de7f',
    'PASSWORD': '9ce1b0e6',
}}


# Password validation
# https://docs.djangoproject.com/en/1.9/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',
    },
]

AUTH_USER_MODEL = 'scanner.CustomUser'


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

LANGUAGE_CODE = 'en-us'

# TIME_ZONE = 'America/Los_Angeles'
TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True




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

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
    ('css', os.path.join(STATIC_ROOT, 'css')),
    ('js', os.path.join(STATIC_ROOT, 'js')),
    ('images', os.path.join(STATIC_ROOT, 'images')),

)


