mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
修复部分代码风格的问题
This commit is contained in:
parent
1a5dadbbd5
commit
66d1aa69f0
@ -1,4 +1,5 @@
|
||||
# coding=utf-8
|
||||
import os
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse, Http404
|
||||
|
||||
@ -7,7 +8,7 @@ from rest_framework.views import APIView
|
||||
|
||||
class AdminTemplateView(APIView):
|
||||
def get(self, request, template_dir, template_name):
|
||||
path = settings.TEMPLATES[0]["DIRS"][0] + "/admin/" + template_dir + "/" + template_name + ".html"
|
||||
path = os.path.join(settings.TEMPLATES[0]["DIRS"][0], "admin", template_dir, template_name + ".html")
|
||||
try:
|
||||
return HttpResponse(open(path).read(), content_type="text/html")
|
||||
except IOError:
|
||||
|
||||
@ -27,13 +27,6 @@ REDIS_QUEUE = {
|
||||
"db": 2
|
||||
}
|
||||
|
||||
|
||||
# for celery
|
||||
BROKER_URL = 'redis://%s:%s/%s' % (REDIS_QUEUE["host"], str(REDIS_QUEUE["port"]), str(REDIS_QUEUE["db"]))
|
||||
CELERY_ACCEPT_CONTENT = ["json"]
|
||||
CELERY_TASK_SERIALIZER = "json"
|
||||
|
||||
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
@ -36,13 +36,6 @@ REDIS_QUEUE = {
|
||||
"db": 2
|
||||
}
|
||||
|
||||
|
||||
# for celery
|
||||
BROKER_URL = 'redis://%s:%s/%s' % (REDIS_QUEUE["host"], str(REDIS_QUEUE["port"]), str(REDIS_QUEUE["db"]))
|
||||
CELERY_ACCEPT_CONTENT = ["json"]
|
||||
CELERY_TASK_SERIALIZER = "json"
|
||||
|
||||
|
||||
DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
@ -173,6 +173,11 @@ else:
|
||||
)
|
||||
}
|
||||
|
||||
# for celery
|
||||
BROKER_URL = 'redis://%s:%s/%s' % (REDIS_QUEUE["host"], str(REDIS_QUEUE["port"]), str(REDIS_QUEUE["db"]))
|
||||
CELERY_ACCEPT_CONTENT = ["json"]
|
||||
CELERY_TASK_SERIALIZER = "json"
|
||||
|
||||
DATABASE_ROUTERS = ['oj.db_router.DBRouter']
|
||||
|
||||
TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user