"""
Django settings for switch_application project.

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

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

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


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'c+jk-+ou_+#i^!bh6k9#9^wvu=t))mkctvg8mk%ktk!(!igyj%'

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

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['*']

# Authentication definition
# django JWT will be used for authentication, 
# https://github.com/GetBlimp/django-rest-framework-jwt
# http://www.django-rest-framework.org/api-guide/authentication
# http://www.django-rest-framework.org/tutorial/4-authentication-and-permissions

REST_FRAMEWORK = {
##   this makes the pop login menu on web brower, and after login in
##   permentarly, logined.
##    'DEFAULT_PERMISSION_CLASSES': (
##        'rest_framework.permissions.IsAuthenticated',
##    ),
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    )
}


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'corsheaders',
    'rest_framework',
    'net_builder',
    'ip_manager',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'switch_application.urls'

WSGI_APPLICATION = 'switch_application.wsgi.application'

## CORS option configuration
## https://github.com/ottoyiu/django-cors-headers will be reference

CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = ('20.0.2.224')
CORS_ORIGIN_REGEX_WHITELIST = ()
CORS_ALLOW_HEADERS = (
        'x-requested-with',
        'content-type',
        'accept',
        'origin',
        'authorization',
        'x-csrftoken',
)
CORS_EXPOSE_HEADERS = ()
CORS_ALLOW_METHODS = (
        'GET',
        'POST',
        'PUT',
        'PATCH',
        'DELETE',
        'OPTIONS'
)

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

DATABASES = {
    'default': {
        #'ENGINE': 'django.db.backends.sqlite3',
        #'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'switch_application',
        'USER': 'root',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/

STATIC_URL = '/static/'

66500acc83ce4980af2ed024b2189338ccfdba77
<mask token>

<mask token>
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'c+jk-+ou_+#i^!bh6k9#9^wvu=t))mkctvg8mk%ktk!(!igyj%'
DEBUG = False
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
REST_FRAMEWORK = {'DEFAULT_AUTHENTICATION_CLASSES': (
    'rest_framework.authentication.BasicAuthentication',
    'rest_framework.authentication.SessionAuthentication',
    'rest_framework_jwt.authentication.JSONWebTokenAuthentication')}
INSTALLED_APPS = ('django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders',
    'rest_framework', 'net_builder', 'ip_manager')
MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware')
ROOT_URLCONF = 'switch_application.urls'
WSGI_APPLICATION = 'switch_application.wsgi.application'
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = '20.0.2.224'
CORS_ORIGIN_REGEX_WHITELIST = ()
CORS_ALLOW_HEADERS = ('x-requested-with', 'content-type', 'accept',
    'origin', 'authorization', 'x-csrftoken')
CORS_EXPOSE_HEADERS = ()
CORS_ALLOW_METHODS = 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'switch_application', 'USER': 'root', 'PASSWORD': 'password', 'HOST':
    'localhost', 'PORT': '3306'}}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'

<mask token>
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'c+jk-+ou_+#i^!bh6k9#9^wvu=t))mkctvg8mk%ktk!(!igyj%'
DEBUG = False
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
REST_FRAMEWORK = {'DEFAULT_AUTHENTICATION_CLASSES': (
    'rest_framework.authentication.BasicAuthentication',
    'rest_framework.authentication.SessionAuthentication',
    'rest_framework_jwt.authentication.JSONWebTokenAuthentication')}
INSTALLED_APPS = ('django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders',
    'rest_framework', 'net_builder', 'ip_manager')
MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware')
ROOT_URLCONF = 'switch_application.urls'
WSGI_APPLICATION = 'switch_application.wsgi.application'
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = '20.0.2.224'
CORS_ORIGIN_REGEX_WHITELIST = ()
CORS_ALLOW_HEADERS = ('x-requested-with', 'content-type', 'accept',
    'origin', 'authorization', 'x-csrftoken')
CORS_EXPOSE_HEADERS = ()
CORS_ALLOW_METHODS = 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'switch_application', 'USER': 'root', 'PASSWORD': 'password', 'HOST':
    'localhost', 'PORT': '3306'}}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'

"""
Django settings for switch_application project.

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

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

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


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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'c+jk-+ou_+#i^!bh6k9#9^wvu=t))mkctvg8mk%ktk!(!igyj%'

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

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['*']

# Authentication definition
# django JWT will be used for authentication, 
# https://github.com/GetBlimp/django-rest-framework-jwt
# http://www.django-rest-framework.org/api-guide/authentication
# http://www.django-rest-framework.org/tutorial/4-authentication-and-permissions

REST_FRAMEWORK = {
##   this makes the pop login menu on web brower, and after login in
##   permentarly, logined.
##    'DEFAULT_PERMISSION_CLASSES': (
##        'rest_framework.permissions.IsAuthenticated',
##    ),
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    )
}


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'corsheaders',
    'rest_framework',
    'net_builder',
    'ip_manager',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'switch_application.urls'

WSGI_APPLICATION = 'switch_application.wsgi.application'

## CORS option configuration
## https://github.com/ottoyiu/django-cors-headers will be reference

CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = ('20.0.2.224')
CORS_ORIGIN_REGEX_WHITELIST = ()
CORS_ALLOW_HEADERS = (
        'x-requested-with',
        'content-type',
        'accept',
        'origin',
        'authorization',
        'x-csrftoken',
)
CORS_EXPOSE_HEADERS = ()
CORS_ALLOW_METHODS = (
        'GET',
        'POST',
        'PUT',
        'PATCH',
        'DELETE',
        'OPTIONS'
)

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

DATABASES = {
    'default': {
        #'ENGINE': 'django.db.backends.sqlite3',
        #'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'switch_application',
        'USER': 'root',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/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/1.6/howto/static-files/

STATIC_URL = '/static/'
