"""
Django settings for PhotoManagementSystem project.

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

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

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

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

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.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '$6#w&i!ng7e34urp0*g2l^1@@y=!bph3!4*#i$o-#fqi^d=$up'

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

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'PhotoManager',
)

MIDDLEWARE_CLASSES = (
    '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',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'PhotoManagementSystem.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            './PhotoManager/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 = 'PhotoManagementSystem.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


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

LANGUAGE_CODE = 'zh-hans'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

MEDIA_URL = '/media/'

@@ -807,16 +807,80 @@
 uction!%0A
+if 'SERVER_SOFTWARE' in os.environ:%0A    DEBUG = False%0Aelse:%0A    
 DEBUG = 
@@ -2367,16 +2367,25 @@
 atabases
+%0A# SQLite
 %0A%0ADATABA
@@ -2520,16 +2520,576 @@
    %7D%0A%7D%0A%0A
+# MySQL%0A'''%0Aif 'SERVER_SOFTWARE' in os.environ:%0A    from sae.const import (%0A        MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB%0A    )%0Aelse:%0A    # Make %60python manage.py syncdb%60 works happy!%0A    MYSQL_HOST = 'localhost'%0A    MYSQL_PORT = '3306'%0A    MYSQL_USER = 'root'%0A    MYSQL_PASS = 'root'%0A    MYSQL_DB = 'pmsys'%0A%0ADATABASES = %7B%0A    'default': %7B%0A        'ENGINE': 'django.db.backends.mysql',%0A        'NAME': MYSQL_DB,%0A        'USER': MYSQL_USER,%0A        'PASSWORD': MYSQL_PASS,%0A        'HOST': MYSQL_HOST,%0A        'PORT': MYSQL_PORT,%0A    %7D%0A%7D%0A'''%0A%0A
 %0A# Inter
@@ -3211,27 +3211,28 @@
 %0AUSE_I18N = 
-Tru
+Fals
 e%0A%0AUSE_L10N 
@@ -3357,16 +3357,16 @@
 files/%0A%0A
-
 STATIC_U
@@ -3382,16 +3382,149 @@
 atic/'%0A%0A
+STATIC_ROOT = os.path.join(BASE_DIR, 'static').replace('%5C%5C', '/')%0A%0ASTATICFILES_DIRS = (%0A    os.path.join(BASE_DIR, %22static_dev%22),%0A)%0A%0A
 MEDIA_RO

add config for SAE