|
@@ -15,7 +15,6 @@ import os
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
-
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
# Quick-start development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
|
|
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
|
|
|
|
|
|
@@ -27,7 +26,6 @@ DEBUG = True
|
|
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
|
|
-
|
|
|
|
# Application definition
|
|
# Application definition
|
|
|
|
|
|
INSTALLED_APPS = [
|
|
INSTALLED_APPS = [
|
|
@@ -74,31 +72,31 @@ TEMPLATES = [
|
|
|
|
|
|
WSGI_APPLICATION = 'azoauth.wsgi.application'
|
|
WSGI_APPLICATION = 'azoauth.wsgi.application'
|
|
|
|
|
|
-
|
|
|
|
# Database
|
|
# Database
|
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
|
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
|
|
|
|
|
|
-DATABASES = {
|
|
|
|
- 'default': {
|
|
|
|
- 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-# DATABASE_DATA = 'alexa_oauth'
|
|
|
|
-# SERVER_HOST = 'azrdsinstance.clraczw4p0yj.us-west-1.rds.amazonaws.com'
|
|
|
|
-# DATABASES_USER = 'azrds'
|
|
|
|
-# DATABASES_PASS = 'azrds.x.x'
|
|
|
|
-#
|
|
|
|
-# DATABASES = {'default': {
|
|
|
|
-# 'ENGINE': 'django.db.backends.mysql',
|
|
|
|
-# 'NAME': DATABASE_DATA,
|
|
|
|
-# 'USER': DATABASES_USER,
|
|
|
|
-# 'PASSWORD': DATABASES_PASS,
|
|
|
|
-# 'HOST': SERVER_HOST,
|
|
|
|
-# 'PORT': '3306',
|
|
|
|
-# 'OPTIONS': {'charset': 'utf8mb4', 'use_unicode': True, 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"},
|
|
|
|
-# 'AUTOCOMMIT': True
|
|
|
|
-# }}
|
|
|
|
|
|
+# DATABASES = {
|
|
|
|
+# 'default': {
|
|
|
|
+# 'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
+# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
+# }
|
|
|
|
+# }
|
|
|
|
+
|
|
|
|
+DATABASE_DATA = 'Alexa'
|
|
|
|
+SERVER_HOST = 'database-2.clraczw4p0yj.us-west-1.rds.amazonaws.com'
|
|
|
|
+DATABASES_USER = 'azrds'
|
|
|
|
+DATABASES_PASS = 'azrds.x.x'
|
|
|
|
+
|
|
|
|
+DATABASES = {'default': {
|
|
|
|
+ 'ENGINE': 'django.db.backends.mysql',
|
|
|
|
+ 'NAME': DATABASE_DATA,
|
|
|
|
+ 'USER': DATABASES_USER,
|
|
|
|
+ 'PASSWORD': DATABASES_PASS,
|
|
|
|
+ 'HOST': SERVER_HOST,
|
|
|
|
+ 'PORT': '3306',
|
|
|
|
+ 'OPTIONS': {'charset': 'utf8mb4', 'use_unicode': True, 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"},
|
|
|
|
+ 'AUTOCOMMIT': True
|
|
|
|
+}}
|
|
|
|
|
|
# Password validation
|
|
# Password validation
|
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
|
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
|
|
@@ -118,7 +116,6 @@ AUTH_PASSWORD_VALIDATORS = [
|
|
},
|
|
},
|
|
]
|
|
]
|
|
|
|
|
|
-
|
|
|
|
# Internationalization
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/2.1/topics/i18n/
|
|
# https://docs.djangoproject.com/en/2.1/topics/i18n/
|
|
|
|
|
|
@@ -132,7 +129,6 @@ USE_L10N = True
|
|
|
|
|
|
USE_TZ = True
|
|
USE_TZ = True
|
|
|
|
|
|
-
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
|
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
|
|
|
|
|
@@ -192,7 +188,7 @@ LOGGING = {
|
|
'info': { # 向文件中输出日志
|
|
'info': { # 向文件中输出日志
|
|
'level': 'INFO',
|
|
'level': 'INFO',
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
|
- 'filename': os.path.join(BASE_DIR+'/logs/', "info.log"), # 日志文件的位置
|
|
|
|
|
|
+ 'filename': os.path.join(BASE_DIR + '/logs/', "info.log"), # 日志文件的位置
|
|
'maxBytes': 300 * 1024 * 1024, # 300M大小
|
|
'maxBytes': 300 * 1024 * 1024, # 300M大小
|
|
'backupCount': 10,
|
|
'backupCount': 10,
|
|
'formatter': 'verbose',
|
|
'formatter': 'verbose',
|
|
@@ -200,11 +196,10 @@ LOGGING = {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
'loggers': { # 日志器
|
|
'loggers': { # 日志器
|
|
- "django": { # 默认的logger应用如下配置
|
|
|
|
|
|
+ "django": { # 默认的logger应用如下配置
|
|
"handlers": ["info", "console"],
|
|
"handlers": ["info", "console"],
|
|
"propagate": True,
|
|
"propagate": True,
|
|
"level": "INFO"
|
|
"level": "INFO"
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|