修改访问设置
This commit is contained in:
@@ -23,7 +23,7 @@ SECRET_KEY = 'yvolr8nvtga=6p!=0g+#8vbpq98xf-0do=cbt#crl$6b^)$qm4'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = ["localhost","127.0.0.1"]
|
||||
|
||||
LOG_DIR = os.path.join(BASE_DIR, "logs")
|
||||
if not os.path.exists(LOG_DIR):
|
||||
|
||||
@@ -88,7 +88,11 @@ def send_code(request):
|
||||
'''
|
||||
注册发送验证码
|
||||
'''
|
||||
postBody = json.loads(request.body)
|
||||
email = postBody.get("email")
|
||||
flag = sendCode(email)
|
||||
msg = ""
|
||||
try:
|
||||
postBody = json.loads(request.body)
|
||||
email = postBody.get("email")
|
||||
flag = sendCode(email)
|
||||
except Exception as e:
|
||||
msg = "请先在服务器配置smtp"
|
||||
return JsonResponse({"msg": flag}, status=200)
|
||||
|
||||
@@ -25,7 +25,7 @@ class EmailService():
|
||||
self.temp_collection = self.mydb["temp"]
|
||||
self.valid_time = 60 * 5
|
||||
|
||||
def send_email(self, to_addr, password='htvviggqfrwobbfc'):
|
||||
def send_email(self, to_addr, password=''):
|
||||
'''
|
||||
:param password: Email authorization code
|
||||
:param to_addr: recevier email address
|
||||
|
||||
Reference in New Issue
Block a user