"""
Django settings for wxauth project.

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

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 codecs
codecs.register(lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None)

# 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 = '69tdcj=)@id&(sacouz(7=lcz@y+0bm%o)!x*stg)m%u@u8ni!'

# 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',
    'config',
    'core',
]

MIDDLEWARE_CLASSES = [
    'core.middleware.GlobalRequestMiddleware',
    '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 = 'wxauth.urls'

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

WSGI_APPLICATION = 'wxauth.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'core',
        'HOST': '127.0.0.1',
        'USER': 'root',
        'PASSWORD': 'root',
        'OPTIONS': {
            'charset': 'utf8mb4',
        }
    },
    'sqlite': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    },
}


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


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

STATIC_URL = '/static/'

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


# WxAuth settings

WXAUTH_APPID = 'wx579e43a4729b1764'
WXAUTH_APPSECRET = 'b90b1beaaef5e8e0e1f51647a3ae5cbc'

@@ -327,91 +327,8 @@
 decs
-%0Acodecs.register(lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None)
 %0A%0A# 
@@ -836,18 +836,20 @@
 OSTS = %5B
+'*'
 %5D
-%0A
 %0A%0A# Appl
@@ -1116,16 +1116,8 @@
 WARE
-_CLASSES
  = %5B
@@ -1442,78 +1442,8 @@
 e',%0A
-    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',%0A
     
@@ -1558,17 +1558,16 @@
 dleware'
-,
 %0A%5D%0A%0AROOT
@@ -2123,17 +2123,16 @@
 ation'%0A%0A
-%0A
 # Databa
@@ -2293,20 +2293,29 @@
 NAME': '
-core
+django_wxauth
 ',%0A     
@@ -2445,16 +2445,202 @@
 f8mb4',%0A
+            'init_command': '''%0A            SET default_storage_engine=INNODB;%0A            SET sql_mode='STRICT_TRANS_TABLES';%0A            SET GLOBAL binlog_format=row;%0A            ''',%0A
         
@@ -2776,17 +2776,16 @@
   %7D,%0A%7D%0A%0A
-%0A
 # Passwo
@@ -3303,17 +3303,16 @@
   %7D,%0A%5D%0A%0A
-%0A
 # Intern
@@ -3422,11 +3422,21 @@
  = '
-UTC
+Asia/Shanghai
 '%0A%0AU
@@ -3477,21 +3477,21 @@
 SE_TZ = 
-True%0A
+False
 %0A%0A# Stat
@@ -3661,115 +3661,27 @@
 /')%0A
-%0A%0A# WxAuth settings%0A%0AWXAUTH_APPID = 'wx579e43a4729b1764'%0AWXAUTH_APPSECRET = 'b90b1beaaef5e8e0e1f51647a3ae5cbc
+MEDIA_URL = '/media/
 '%0A
+%0A

clean clean clean