修复部分代码风格的问题

This commit is contained in:
virusdefender 2016-04-30 19:27:20 +08:00
parent 1a5dadbbd5
commit 66d1aa69f0
No known key found for this signature in database
GPG Key ID: 1686FB5677979E61
4 changed files with 7 additions and 15 deletions

View File

@ -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:

View File

@ -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 = []

View File

@ -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 = ['*']

View File

@ -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/')