2015-06-26 07:59:53 +00:00
|
|
|
|
# coding=utf-8
|
2015-08-02 00:50:38 +00:00
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
|
'default': {
|
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
2015-08-17 04:48:10 +00:00
|
|
|
|
},
|
2015-09-08 03:03:59 +00:00
|
|
|
|
# submission 的 name 和 engine 请勿修改,其他代码会用到
|
2015-08-17 04:48:10 +00:00
|
|
|
|
'submission': {
|
2015-10-20 12:09:23 +00:00
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db1.sqlite3'),
|
2015-08-02 00:50:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-12 12:00:56 +00:00
|
|
|
|
REDIS_CACHE = {
|
2015-10-20 12:09:23 +00:00
|
|
|
|
"host": "127.0.0.1",
|
2015-09-12 12:00:56 +00:00
|
|
|
|
"port": 6379,
|
|
|
|
|
"db": 1
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-07 11:15:28 +00:00
|
|
|
|
REDIS_QUEUE = {
|
|
|
|
|
"host": "127.0.0.1",
|
|
|
|
|
"port": 6379,
|
|
|
|
|
"db": 2
|
|
|
|
|
}
|
2015-11-29 13:29:26 +00:00
|
|
|
|
|
2015-12-12 07:41:57 +00:00
|
|
|
|
|
|
|
|
|
# for celery
|
|
|
|
|
BROKER_URL = 'redis://%s:%s/%s' % (REDIS_QUEUE["host"], str(REDIS_QUEUE["port"]), str(REDIS_QUEUE["db"]))
|
|
|
|
|
ACCEPT_CONTENT = ['json']
|
|
|
|
|
|
|
|
|
|
|
2015-08-12 06:01:34 +00:00
|
|
|
|
DEBUG = True
|
|
|
|
|
|
2015-08-31 08:30:31 +00:00
|
|
|
|
ALLOWED_HOSTS = []
|
2015-09-11 12:34:15 +00:00
|
|
|
|
|
2015-09-14 10:20:36 +00:00
|
|
|
|
# 在 debug 关闭的情况下,静态文件不是有 django runserver 来处理的,应该由 nginx 返回
|
|
|
|
|
# 在 debug 开启的情况下,django 会在下面两个文件夹中寻找对应的静态文件。
|
|
|
|
|
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static/src/"), BASE_DIR]
|
2015-09-14 05:57:03 +00:00
|
|
|
|
|
2015-09-14 10:20:36 +00:00
|
|
|
|
# 模板文件夹
|
2016-01-26 04:58:08 +00:00
|
|
|
|
OJ_TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'template/src/')]
|
2015-10-20 12:09:23 +00:00
|
|
|
|
|