update release note

update sentry settings
This commit is contained in:
virusdefender
2018-01-04 20:13:50 +08:00
parent b388c5dd03
commit 0e1d40792f
3 changed files with 9 additions and 14 deletions

View File

@@ -86,7 +86,7 @@ class UserProfileSerializer(serializers.ModelSerializer):
class EditUserSerializer(serializers.Serializer): class EditUserSerializer(serializers.Serializer):
id = serializers.IntegerField() id = serializers.IntegerField()
username = serializers.CharField(max_length=32) username = serializers.CharField(max_length=32)
real_name = serializers.CharField(max_length=32, allow_blank=True) real_name = serializers.CharField(max_length=32, allow_blank=True, allow_null=True)
password = serializers.CharField(min_length=6, allow_blank=True, required=False, default=None) password = serializers.CharField(min_length=6, allow_blank=True, required=False, default=None)
email = serializers.EmailField(max_length=64) email = serializers.EmailField(max_length=64)
admin_type = serializers.ChoiceField(choices=(AdminType.REGULAR_USER, AdminType.ADMIN, AdminType.SUPER_ADMIN)) admin_type = serializers.ChoiceField(choices=(AdminType.REGULAR_USER, AdminType.ADMIN, AdminType.SUPER_ADMIN))

View File

@@ -1,14 +1,15 @@
{ {
"update": [ "update": [
{ {
"version": "2017-12-25", "version": "2017-01-04",
"level": "Recommend", "level": "Recommend",
"title": "Update at 2017-12-25", "title": "Update at 2018-01-04",
"details": [ "details": [
"Fix some issues under IE/Edge", "Fix some issues under IE/Edge",
"Add backend error reporter", "Add backend error reporter",
"New email template", "New email template",
"A more flexible throttling function", "A more flexible throttling function",
"Add admin dashboard (this page)",
"Other bugs and enhancements" "Other bugs and enhancements"
] ]
} }

View File

@@ -12,14 +12,15 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
import os import os
import raven import raven
from copy import deepcopy from copy import deepcopy
from utils.shortcuts import get_env
from .custom_settings import *
if os.environ.get("OJ_ENV") == "production": production_env = get_env("OJ_ENV", "dev") == "production"
if production_env:
from .production_settings import * from .production_settings import *
else: else:
from .dev_settings import * from .dev_settings import *
from .custom_settings import *
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Applications # Applications
@@ -128,7 +129,7 @@ UPLOAD_DIR = f"{DATA_DIR}{UPLOAD_PREFIX}"
STATICFILES_DIRS = [os.path.join(DATA_DIR, "public")] STATICFILES_DIRS = [os.path.join(DATA_DIR, "public")]
LOGGING_HANDLERS = ['console'] if DEBUG else ['console', 'sentry'] LOGGING_HANDLERS = ['console', 'sentry'] if production_env else ['console']
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': False, 'disable_existing_loggers': False,
@@ -204,13 +205,6 @@ BROKER_URL = f"{REDIS_URL}/3"
CELERY_TASK_SOFT_TIME_LIMIT = CELERY_TASK_TIME_LIMIT = 180 CELERY_TASK_SOFT_TIME_LIMIT = CELERY_TASK_TIME_LIMIT = 180
CELERY_ACCEPT_CONTENT = ["json"] CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TASK_SERIALIZER = "json" CELERY_TASK_SERIALIZER = "json"
# 用于限制用户恶意提交大量代码
TOKEN_BUCKET_DEFAULT_CAPACITY = 10
# 单位:每分钟
TOKEN_BUCKET_FILL_RATE = 2
RAVEN_CONFIG = { RAVEN_CONFIG = {
'dsn': 'https://b200023b8aed4d708fb593c5e0a6ad3d:1fddaba168f84fcf97e0d549faaeaff0@sentry.io/263057' 'dsn': 'https://b200023b8aed4d708fb593c5e0a6ad3d:1fddaba168f84fcf97e0d549faaeaff0@sentry.io/263057'
} }