This commit is contained in:
gjj 2021-12-29 22:25:27 +08:00
parent 24cc18cee8
commit d92f999b64
41 changed files with 2194 additions and 239 deletions

View File

@ -114,7 +114,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia\Shanghai'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
@ -137,24 +137,24 @@ STATICFILES_DIRS=[
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# CACHES = {
# "default":{ #默认
# "BACKEND":"django_redis.cache.RedisCache",
# "LOCATION":"redis://127.0.0.1:6379/0",
# "OPTIONS":{
# "CLIENT_CLASS":"django_redis.client.DefaultClient",
# },
# },
# "session":{#session
# "BACKEND":"django_redis.cache.RedisCache",
# "LOCATION":"redis://127.0.0.1:6379/1",
# "OPTIONS":{
# "CLIENT_CLASS":"django_redis.client.DefaultClient",
# }
# },
# }
# SESSION_ENGINE ="django.contrib.sessions.backends.cache"
# SESSION_CACHE_ALIAS ="session"
CACHES = {
"default": { # 默认
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/0",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
},
"session": { # session
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
},
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "session"
#日志
@ -200,4 +200,5 @@ LOGGING = {
'level': 'INFO', # 日志器接收的最低日志级别
},
}
}
}
AUTH_USER_MODEL = 'users.User'

View File

@ -14,12 +14,12 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.http import HttpResponse
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path,include
#导入系统logging
# import logging
# #创建获取日志器
@ -32,7 +32,10 @@ from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include(('users.urls', 'users'), namespace='users')),
path('', include(('home.urls', 'home'), namespace='home')),]
path('', include(('home.urls', 'home'), namespace='home')),
# include 参数1要设置为元组urlconf_module, app_name
# namespace 设置命名空间
]
# path('',log),
# ]+static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -2,4 +2,6 @@ from django.urls import path
from home.views import IndexView
urlpatterns = [
path('', IndexView.as_view(),name='index'),
]

0
blog/libs/__init__.py Normal file
View File

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,220 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# refer to `https://bitbucket.org/akorn/wheezy.captcha`
import random
import string
import os.path
from io import BytesIO
from PIL import Image
from PIL import ImageFilter
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
class Bezier:
def __init__(self):
self.tsequence = tuple([t / 20.0 for t in range(21)])
self.beziers = {}
def pascal_row(self, n):
""" Returns n-th row of Pascal's triangle
"""
result = [1]
x, numerator = 1, n
for denominator in range(1, n // 2 + 1):
x *= numerator
x /= denominator
result.append(x)
numerator -= 1
if n & 1 == 0:
result.extend(reversed(result[:-1]))
else:
result.extend(reversed(result))
return result
def make_bezier(self, n):
""" Bezier curves:
http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Generalization
"""
try:
return self.beziers[n]
except KeyError:
combinations = self.pascal_row(n - 1)
result = []
for t in self.tsequence:
tpowers = (t ** i for i in range(n))
upowers = ((1 - t) ** i for i in range(n - 1, -1, -1))
coefs = [c * a * b for c, a, b in zip(combinations,
tpowers, upowers)]
result.append(coefs)
self.beziers[n] = result
return result
class Captcha(object):
def __init__(self):
self._bezier = Bezier()
self._dir = os.path.dirname(__file__)
# self._captcha_path = os.path.join(self._dir, '..', 'static', 'captcha')
@staticmethod
def instance():
if not hasattr(Captcha, "_instance"):
Captcha._instance = Captcha()
return Captcha._instance
def initialize(self, width=200, height=75, color=None, text=None, fonts=None):
# self.image = Image.new('RGB', (width, height), (255, 255, 255))
self._text = text if text else random.sample(string.ascii_uppercase + string.ascii_uppercase + '3456789', 4)
self.fonts = fonts if fonts else \
[os.path.join(self._dir, 'fonts', font) for font in ['Arial.ttf', 'Georgia.ttf', 'actionj.ttf']]
self.width = width
self.height = height
self._color = color if color else self.random_color(0, 200, random.randint(220, 255))
@staticmethod
def random_color(start, end, opacity=None):
red = random.randint(start, end)
green = random.randint(start, end)
blue = random.randint(start, end)
if opacity is None:
return red, green, blue
return red, green, blue, opacity
# draw image
def background(self, image):
Draw(image).rectangle([(0, 0), image.size], fill=self.random_color(238, 255))
return image
@staticmethod
def smooth(image):
return image.filter(ImageFilter.SMOOTH)
def curve(self, image, width=4, number=6, color=None):
dx, height = image.size
dx /= number
path = [(dx * i, random.randint(0, height))
for i in range(1, number)]
bcoefs = self._bezier.make_bezier(number - 1)
points = []
for coefs in bcoefs:
points.append(tuple(sum([coef * p for coef, p in zip(coefs, ps)])
for ps in zip(*path)))
Draw(image).line(points, fill=color if color else self._color, width=width)
return image
def noise(self, image, number=50, level=2, color=None):
width, height = image.size
dx = width / 10
width -= dx
dy = height / 10
height -= dy
draw = Draw(image)
for i in range(number):
x = int(random.uniform(dx, width))
y = int(random.uniform(dy, height))
draw.line(((x, y), (x + level, y)), fill=color if color else self._color, width=level)
return image
def text(self, image, fonts, font_sizes=None, drawings=None, squeeze_factor=0.75, color=None):
color = color if color else self._color
fonts = tuple([truetype(name, size)
for name in fonts
for size in font_sizes or (65, 70, 75)])
draw = Draw(image)
char_images = []
for c in self._text:
font = random.choice(fonts)
c_width, c_height = draw.textsize(c, font=font)
char_image = Image.new('RGB', (c_width, c_height), (0, 0, 0))
char_draw = Draw(char_image)
char_draw.text((0, 0), c, font=font, fill=color)
char_image = char_image.crop(char_image.getbbox())
for drawing in drawings:
d = getattr(self, drawing)
char_image = d(char_image)
char_images.append(char_image)
width, height = image.size
offset = int((width - sum(int(i.size[0] * squeeze_factor)
for i in char_images[:-1]) -
char_images[-1].size[0]) / 2)
for char_image in char_images:
c_width, c_height = char_image.size
mask = char_image.convert('L').point(lambda i: i * 1.97)
image.paste(char_image,
(offset, int((height - c_height) / 2)),
mask)
offset += int(c_width * squeeze_factor)
return image
# draw text
@staticmethod
def warp(image, dx_factor=0.27, dy_factor=0.21):
width, height = image.size
dx = width * dx_factor
dy = height * dy_factor
x1 = int(random.uniform(-dx, dx))
y1 = int(random.uniform(-dy, dy))
x2 = int(random.uniform(-dx, dx))
y2 = int(random.uniform(-dy, dy))
image2 = Image.new('RGB',
(width + abs(x1) + abs(x2),
height + abs(y1) + abs(y2)))
image2.paste(image, (abs(x1), abs(y1)))
width2, height2 = image2.size
return image2.transform(
(width, height), Image.QUAD,
(x1, y1,
-x1, height2 - y2,
width2 + x2, height2 + y2,
width2 - x2, -y1))
@staticmethod
def offset(image, dx_factor=0.1, dy_factor=0.2):
width, height = image.size
dx = int(random.random() * width * dx_factor)
dy = int(random.random() * height * dy_factor)
image2 = Image.new('RGB', (width + dx, height + dy))
image2.paste(image, (dx, dy))
return image2
@staticmethod
def rotate(image, angle=25):
return image.rotate(
random.uniform(-angle, angle), Image.BILINEAR, expand=1)
def captcha(self, path=None, fmt='JPEG'):
"""Create a captcha.
Args:
path: save path, default None.
fmt: image format, PNG / JPEG.
Returns:
A tuple, (text, StringIO.value).
For example:
('JGW9', '\x89PNG\r\n\x1a\n\x00\x00\x00\r...')
"""
image = Image.new('RGB', (self.width, self.height), (255, 255, 255))
image = self.background(image)
image = self.text(image, self.fonts, drawings=['warp', 'rotate', 'offset'])
image = self.curve(image)
image = self.noise(image)
image = self.smooth(image)
text = "".join(self._text)
out = BytesIO()
image.save(out, format=fmt)
return text, out.getvalue()
def generate_captcha(self):
self.initialize()
return self.captcha("")
captcha = Captcha.instance()
if __name__ == '__main__':
print(captcha.generate_captcha())

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,801 @@
# -*- coding: UTF-8 -*-
# Copyright (c) 2014 The CCP project authors. All Rights Reserved.
#
# Use of this source code is governed by a Beijing Speedtong Information Technology Co.,Ltd license
# that can be found in the LICENSE file in the root of the web site.
#
# http://www.yuntongxun.com
#
# An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
from hashlib import md5
import base64
import datetime
from urllib import request as urllib2
import json
from .xmltojson import xmltojson
class REST:
AccountSid = ''
AccountToken = ''
AppId = ''
SubAccountSid = ''
SubAccountToken = ''
ServerIP = ''
ServerPort = ''
SoftVersion = ''
Iflog = False # 是否打印日志
Batch = '' # 时间戳
BodyType = 'xml' # 包体格式可填值json 、xml
# 初始化
# @param serverIP 必选参数 服务器地址
# @param serverPort 必选参数 服务器端口
# @param softVersion 必选参数 REST版本号
def __init__(self, ServerIP, ServerPort, SoftVersion):
self.ServerIP = ServerIP
self.ServerPort = ServerPort
self.SoftVersion = SoftVersion
# 设置主帐号
# @param AccountSid 必选参数 主帐号
# @param AccountToken 必选参数 主帐号Token
def setAccount(self, AccountSid, AccountToken):
self.AccountSid = AccountSid
self.AccountToken = AccountToken
# 设置子帐号
#
# @param SubAccountSid 必选参数 子帐号
# @param SubAccountToken 必选参数 子帐号Token
def setSubAccount(self, SubAccountSid, SubAccountToken):
self.SubAccountSid = SubAccountSid
self.SubAccountToken = SubAccountToken
# 设置应用ID
#
# @param AppId 必选参数 应用ID
def setAppId(self, AppId):
self.AppId = AppId
def log(self, url, body, data):
print('这是请求的URL')
print(url)
print('这是请求包体:')
print(body)
print('这是响应包体:')
print(data)
print('********************************')
# 创建子账号
# @param friendlyName 必选参数 子帐号名称
def CreateSubAccount(self, friendlyName):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/SubAccounts?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# xml格式
body = '''<?xml version="1.0" encoding="utf-8"?><SubAccount><appId>%s</appId>\
<friendlyName>%s</friendlyName>\
</SubAccount>\
''' % (self.AppId, friendlyName)
if self.BodyType == 'json':
# json格式
body = '''{"friendlyName": "%s", "appId": "%s"}''' % (friendlyName, self.AppId)
data = ''
req.data = body.encode()
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 获取子帐号
# @param startNo 可选参数 开始的序号默认从0开始
# @param offset 可选参数 一次查询的最大条数最小是1条最大是100条
def getSubAccounts(self, startNo, offset):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/GetSubAccounts?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
# auth = base64.encodestring(src).strip()
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# xml格式
body = '''<?xml version="1.0" encoding="utf-8"?><SubAccount><appId>%s</appId>\
<startNo>%s</startNo><offset>%s</offset>\
</SubAccount>\
''' % (self.AppId, startNo, offset)
if self.BodyType == 'json':
# json格式
body = '''{"appId": "%s", "startNo": "%s", "offset": "%s"}''' % (self.AppId, startNo, offset)
data = ''
req.data = body.encode()
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 子帐号信息查询
# @param friendlyName 必选参数 子帐号名称
def querySubAccount(self, friendlyName):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/QuerySubAccountByName?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
# auth = base64.encodestring(src).strip()
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><SubAccount><appId>%s</appId>\
<friendlyName>%s</friendlyName>\
</SubAccount>\
''' % (self.AppId, friendlyName)
if self.BodyType == 'json':
body = '''{"friendlyName": "%s", "appId": "%s"}''' % (friendlyName, self.AppId)
data = ''
req.data = body.encode()
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 发送模板短信
# @param to 必选参数 短信接收彿手机号码集合,用英文逗号分开
# @param datas 可选参数 内容数据
# @param tempId 必选参数 模板Id
def sendTemplateSMS(self, to, datas, tempId):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/SMS/TemplateSMS?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
# auth = base64.encodestring(src).strip()
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
b = ''
for a in datas:
b += '<data>%s</data>' % (a)
body = '<?xml version="1.0" encoding="utf-8"?><SubAccount><datas>' + b + '</datas><to>%s</to><templateId>%s</templateId><appId>%s</appId>\
</SubAccount>\
' % (to, tempId, self.AppId)
if self.BodyType == 'json':
# if this model is Json ..then do next code
b = '['
for a in datas:
b += '"%s",' % (a)
b += ']'
body = '''{"to": "%s", "datas": %s, "templateId": "%s", "appId": "%s"}''' % (to, b, tempId, self.AppId)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 外呼通知
# @param to 必选参数 被叫号码
# @param mediaName 可选参数 语音文件名称,格式 wav。与mediaTxt不能同时为空。当不为空时mediaTxt属性失效。
# @param mediaTxt 可选参数 文本内容
# @param displayNum 可选参数 显示的主叫号码
# @param playTimes 可选参数 循环播放次数13次默认播放1次。
# @param respUrl 可选参数 外呼通知状态通知回调地址云通讯平台将向该Url地址发送呼叫结果通知。
# @param userData 可选参数 用户私有数据
# @param maxCallTime 可选参数 最大通话时长
# @param speed 可选参数 发音速度
# @param volume 可选参数 音量
# @param pitch 可选参数 音调
# @param bgsound 可选参数 背景音编号
def landingCall(self, to, mediaName, mediaTxt, displayNum, playTimes, respUrl, userData, maxCallTime, speed, volume,
pitch, bgsound):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/Calls/LandingCalls?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
# auth = base64.encodestring(src).strip()
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><LandingCall>\
<to>%s</to><mediaName>%s</mediaName><mediaTxt>%s</mediaTxt><appId>%s</appId><displayNum>%s</displayNum>\
<playTimes>%s</playTimes><respUrl>%s</respUrl><userData>%s</userData><maxCallTime>%s</maxCallTime><speed>%s</speed>
<volume>%s</volume><pitch>%s</pitch><bgsound>%s</bgsound></LandingCall>\
''' % (
to, mediaName, mediaTxt, self.AppId, displayNum, playTimes, respUrl, userData, maxCallTime, speed, volume,
pitch, bgsound)
if self.BodyType == 'json':
body = '''{"to": "%s", "mediaName": "%s","mediaTxt": "%s","appId": "%s","displayNum": "%s","playTimes": "%s","respUrl": "%s","userData": "%s","maxCallTime": "%s","speed": "%s","volume": "%s","pitch": "%s","bgsound": "%s"}''' % (
to, mediaName, mediaTxt, self.AppId, displayNum, playTimes, respUrl, userData, maxCallTime, speed, volume,
pitch, bgsound)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 语音验证码
# @param verifyCode 必选参数 验证码内容为数字和英文字母不区分大小写长度4-8位
# @param playTimes 可选参数 播放次数13次
# @param to 必选参数 接收号码
# @param displayNum 可选参数 显示的主叫号码
# @param respUrl 可选参数 语音验证码状态通知回调地址云通讯平台将向该Url地址发送呼叫结果通知
# @param lang 可选参数 语言类型
# @param userData 可选参数 第三方私有数据
def voiceVerify(self, verifyCode, playTimes, to, displayNum, respUrl, lang, userData):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/Calls/VoiceVerify?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
# auth = base64.encodestring(src).strip()
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><VoiceVerify>\
<appId>%s</appId><verifyCode>%s</verifyCode><playTimes>%s</playTimes><to>%s</to><respUrl>%s</respUrl>\
<displayNum>%s</displayNum><lang>%s</lang><userData>%s</userData></VoiceVerify>\
''' % (self.AppId, verifyCode, playTimes, to, respUrl, displayNum, lang, userData)
if self.BodyType == 'json':
# if this model is Json ..then do next code
body = '''{"appId": "%s", "verifyCode": "%s","playTimes": "%s","to": "%s","respUrl": "%s","displayNum": "%s","lang": "%s","userData": "%s"}''' % (
self.AppId, verifyCode, playTimes, to, respUrl, displayNum, lang, userData)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# IVR外呼
# @param number 必选参数 待呼叫号码为Dial节点的属性
# @param userdata 可选参数 用户数据,在<startservice>通知中返回只允许填写数字字符为Dial节点的属性
# @param record 可选参数 是否录音可填项为true和false默认值为false不录音为Dial节点的属性
def ivrDial(self, number, userdata, record):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch;
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/ivr/dial?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
req.add_header("Accept", "application/xml")
req.add_header("Content-Type", "application/xml;charset=utf-8")
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?>
<Request>
<Appid>%s</Appid>
<Dial number="%s" userdata="%s" record="%s"></Dial>
</Request>
''' % (self.AppId, number, userdata, record)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 话单下载
# @param date 必选参数 day 代表前一天的数据从00:00 23:59目前只支持按天查询
# @param keywords 可选参数 客户的查询条件,由客户自行定义并提供给云通讯平台。默认不填忽略此参数
def billRecords(self, date, keywords):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/BillRecords?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><BillRecords>\
<appId>%s</appId><date>%s</date><keywords>%s</keywords>\
</BillRecords>\
''' % (self.AppId, date, keywords)
if self.BodyType == 'json':
# if this model is Json ..then do next code
body = '''{"appId": "%s", "date": "%s","keywords": "%s"}''' % (self.AppId, date, keywords)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 主帐号信息查询
def queryAccountInfo(self):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/AccountInfo?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
body = ''
req.add_header("Authorization", auth)
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 短信模板查询
# @param templateId 必选参数 模板Id不带此参数查询全部可用模板
def QuerySMSTemplate(self, templateId):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/SMS/QuerySMSTemplate?sig=" + sig
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><Request>\
<appId>%s</appId><templateId>%s</templateId></Request>
''' % (self.AppId, templateId)
if self.BodyType == 'json':
# if this model is Json ..then do next code
body = '''{"appId": "%s", "templateId": "%s"}''' % (self.AppId, templateId)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main2(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 呼叫结果查询
# @param callsid 必选参数 呼叫ID
def CallResult(self, callSid):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/CallResult?sig=" + sig + "&callsid=" + callSid
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
body = ''
req.add_header("Authorization", auth)
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 呼叫状态查询
# @param callid 必选参数 一个由32个字符组成的电话唯一标识符
# @param action 可选参数 查询结果通知的回调url地址
def QueryCallState(self, callid, action):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/ivr/call?sig=" + sig + "&callid=" + callid
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
self.setHttpHeader(req)
req.add_header("Authorization", auth)
# 创建包体
body = '''<?xml version="1.0" encoding="utf-8"?><Request>\
<Appid>%s</Appid><QueryCallState callid="%s" action="%s"/>\
</Request>\
''' % (self.AppId, callid, action)
if self.BodyType == 'json':
# if this model is Json ..then do next code
body = '''{"Appid":"%s","QueryCallState":{"callid":"%s","action":"%s"}}''' % (self.AppId, callid, action)
req.data = body.encode()
data = ''
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 语音文件上传
# @param filename 必选参数 文件名
# @param body 必选参数 二进制串
def MediaFileUpload(self, filename, body):
self.accAuth()
nowdate = datetime.datetime.now()
self.Batch = nowdate.strftime("%Y%m%d%H%M%S")
# 生成sig
signature = self.AccountSid + self.AccountToken + self.Batch
sig = md5(signature.encode()).hexdigest().upper()
# 拼接URL
url = "https://" + self.ServerIP + ":" + self.ServerPort + "/" + self.SoftVersion + "/Accounts/" + self.AccountSid + "/Calls/MediaFileUpload?sig=" + sig + "&appid=" + self.AppId + "&filename=" + filename
# 生成auth
src = self.AccountSid + ":" + self.Batch
auth = base64.encodebytes(src.encode()).decode().strip()
req = urllib2.Request(url)
req.add_header("Authorization", auth)
if self.BodyType == 'json':
req.add_header("Accept", "application/json")
req.add_header("Content-Type", "application/octet-stream")
else:
req.add_header("Accept", "application/xml")
req.add_header("Content-Type", "application/octet-stream")
# 创建包体
req.data = body.encode()
try:
res = urllib2.urlopen(req)
data = res.read()
res.close()
if self.BodyType == 'json':
# json格式
locations = json.loads(data)
else:
# xml格式
xtj = xmltojson()
locations = xtj.main(data)
if self.Iflog:
self.log(url, body, data)
return locations
except Exception as error:
if self.Iflog:
self.log(url, body, data)
return {'172001': '网络错误'}
# 子帐号鉴权
def subAuth(self):
if (self.ServerIP == ""):
print('172004')
print('IP为空')
if (int(self.ServerPort) <= 0):
print('172005')
print('端口错误小于等于0')
if (self.SoftVersion == ""):
print('172013')
print('版本号为空')
if (self.SubAccountSid == ""):
print('172008')
print('子帐号为空')
if (self.SubAccountToken == ""):
print('172009')
print('子帐号令牌为空')
if (self.AppId == ""):
print('172012')
print('应用ID为空')
# 主帐号鉴权
def accAuth(self):
if (self.ServerIP == ""):
print('172004')
print('IP为空')
if (int(self.ServerPort) <= 0):
print('172005')
print('端口错误小于等于0')
if (self.SoftVersion == ""):
print('172013')
print('版本号为空')
if (self.AccountSid == ""):
print('172006')
print('主帐号为空')
if (self.AccountToken == ""):
print('172007')
print('主帐号令牌为空')
if (self.AppId == ""):
print('172012')
print('应用ID为空')
# 设置包头
def setHttpHeader(self, req):
if self.BodyType == 'json':
req.add_header("Accept", "application/json")
req.add_header("Content-Type", "application/json;charset=utf-8")
else:
req.add_header("Accept", "application/xml")
req.add_header("Content-Type", "application/xml;charset=utf-8")

View File

View File

@ -0,0 +1,75 @@
# -*- coding:utf-8 -*-
from libs.yuntongxun.CCPRestSDK import REST
# 说明:主账号,登陆云通讯网站后,可在"控制台-应用"中看到开发者主账号ACCOUNT SID
_accountSid = '8a216da87e0595ef017e064eefcc00cd'
# 说明主账号Token登陆云通讯网站后可在控制台-应用中看到开发者主账号AUTH TOKEN
_accountToken = '38795c32c26040dfb4b5c23c655dd1d5'
# 请使用管理控制台首页的APPID或自己创建应用的APPID
_appId = '8a216da87e0595ef017e064ef0d300d4'
# 说明请求地址生产环境配置成app.cloopen.com
_serverIP = 'sandboxapp.cloopen.com'
# 说明:请求端口 生产环境为8883
_serverPort = "8883"
# 说明REST API版本号保持不变
_softVersion = '2013-12-26'
# 云通讯官方提供的发送短信代码实例
# # 发送模板短信
# # @param to 手机号码
# # @param datas 内容数据 格式为数组 例如:{'12','34'},如不需替换请填 ''
# # @param $tempId 模板Id
#
# def sendTemplateSMS(to, datas, tempId):
# # 初始化REST SDK
# rest = REST(serverIP, serverPort, softVersion)
# rest.setAccount(accountSid, accountToken)
# rest.setAppId(appId)
#
# result = rest.sendTemplateSMS(to, datas, tempId)
# for k, v in result.iteritems():
#
# if k == 'templateSMS':
# for k, s in v.iteritems():
# print '%s:%s' % (k, s)
# else:
# print '%s:%s' % (k, v)
class CCP(object):
"""发送短信的辅助类"""
def __new__(cls, *args, **kwargs):
# 判断是否存在类属性_instance_instance是类CCP的唯一对象即单例
if not hasattr(CCP, "_instance"):
cls._instance = super(CCP, cls).__new__(cls, *args, **kwargs)
cls._instance.rest = REST(_serverIP, _serverPort, _softVersion)
cls._instance.rest.setAccount(_accountSid, _accountToken)
cls._instance.rest.setAppId(_appId)
return cls._instance
def send_template_sms(self, to, datas, temp_id):
"""发送模板短信"""
# @param to 手机号码
# @param datas 内容数据 格式为数组 例如:{'12','34'},如不需替换请填 ''
# @param temp_id 模板Id
result = self.rest.sendTemplateSMS(to, datas, temp_id)
# 如果云通讯发送短信成功返回的字典数据result中statuCode字段的值为"000000"
if result.get("statusCode") == "000000":
# 返回0 表示发送短信成功
return 0
else:
# 返回-1 表示发送失败
return -1
if __name__ == '__main__':
ccp = CCP()
# 注意: 测试的短信模板编号为1
ccp.send_template_sms('18368421420', ['1234', 5], 1)

View File

@ -0,0 +1,170 @@
# -*- coding: utf-8 -*-
# python xml.etree.ElementTree
import os
import xml.etree.ElementTree as ET
from xml.dom import minidom
class xmltojson:
# global var
# show log
SHOW_LOG = True
# XML file
XML_PATH = None
a = {}
m = []
def get_root(self, path):
'''parse the XML file,and get the tree of the XML file
finally,return the root element of the tree.
if the XML file dose not exist,then print the information'''
# if os.path.exists(path):
# if SHOW_LOG:
# print('start to parse the file : [{}]'.format(path))
tree = ET.fromstring(path)
return tree
# else:
# print('the path [{}] dose not exist!'.format(path))
def get_element_tag(self, element):
'''return the element tag if the element is not None.'''
if element is not None:
return element.tag
else:
print('the element is None!')
def get_element_attrib(self, element):
'''return the element attrib if the element is not None.'''
if element is not None:
return element.attrib
else:
print('the element is None!')
def get_element_text(self, element):
'''return the text of the element.'''
if element is not None:
return element.text
else:
print('the element is None!')
def get_element_children(self, element):
'''return the element children if the element is not None.'''
if element is not None:
return [c for c in element]
else:
print('the element is None!')
def get_elements_tag(self, elements):
'''return the list of tags of element's tag'''
if elements is not None:
tags = []
for e in elements:
tags.append(e.tag)
return tags
else:
print('the elements is None!')
def get_elements_attrib(self, elements):
'''return the list of attribs of element's attrib'''
if elements is not None:
attribs = []
for a in elements:
attribs.append(a.attrib)
return attribs
else:
print('the elements is None!')
def get_elements_text(self, elements):
'''return the dict of element'''
if elements is not None:
text = []
for t in elements:
text.append(t.text)
return dict(zip(self.get_elements_tag(elements), text))
else:
print('the elements is None!')
def main(self, xml):
# root
root = self.get_root(xml)
# children
children = self.get_element_children(root)
children_tags = self.get_elements_tag(children)
children_attribs = self.get_elements_attrib(children)
i = 0
# 获取二级元素的每一个子节点的名称和值
for c in children:
p = 0
c_children = self.get_element_children(c)
dict_text = self.get_elements_text(c_children)
if dict_text:
# print (children_tags[i])
if children_tags[i] == 'TemplateSMS':
self.a['templateSMS'] = dict_text
else:
if children_tags[i] == 'SubAccount':
k = 0
for x in children:
if children_tags[k] == 'totalCount':
self.m.append(dict_text)
self.a['SubAccount'] = self.m
p = 1
k = k + 1
if p == 0:
self.a[children_tags[i]] = dict_text
else:
self.a[children_tags[i]] = dict_text
else:
self.a[children_tags[i]] = c.text
i = i + 1
return self.a
def main2(self, xml):
# root
root = self.get_root(xml)
# children
children = self.get_element_children(root)
children_tags = self.get_elements_tag(children)
children_attribs = self.get_elements_attrib(children)
i = 0
# 获取二级元素的每一个子节点的名称和值
for c in children:
p = 0
c_children = self.get_element_children(c)
dict_text = self.get_elements_text(c_children)
if dict_text:
if children_tags[i] == 'TemplateSMS':
k = 0
for x in children:
if children_tags[k] == 'totalCount':
self.m.append(dict_text)
self.a['TemplateSMS'] = self.m
p = 1
k = k + 1
if p == 0:
self.a[children_tags[i]] = dict_text
else:
self.a[children_tags[i]] = dict_text
else:
self.a[children_tags[i]] = c.text
i = i + 1
return self.a

View File

@ -848,3 +848,722 @@ WARNING 2021-12-29 13:47:26,316 basehttp 124 "GET /static/wenzhang.html HTTP/1.1
INFO 2021-12-29 13:47:39,336 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:47:40,530 basehttp 124 "GET / HTTP/1.1" 200 4894
WARNING 2021-12-29 13:47:41,259 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 404 1663
INFO 2021-12-29 13:49:04,056 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:49:04,174 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 13:49:05,486 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 200 12002
INFO 2021-12-29 13:51:43,520 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:51:43,661 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 13:51:43,703 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 13:51:43,704 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
WARNING 2021-12-29 13:51:43,772 log 222 Not Found: /favicon.ico
WARNING 2021-12-29 13:51:43,773 basehttp 124 "GET /favicon.ico HTTP/1.1" 404 2471
INFO 2021-12-29 13:54:59,842 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:54:59,983 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 13:55:00,028 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 13:55:53,181 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:55:58,125 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 200 11818
INFO 2021-12-29 13:56:06,343 basehttp 124 "GET /static/write_blog.html HTTP/1.1" 200 5750
INFO 2021-12-29 13:56:06,365 basehttp 124 "GET /static/js/write_blog.js HTTP/1.1" 200 521
INFO 2021-12-29 13:56:06,433 basehttp 124 "GET /static/ckeditor/ckeditor/lang/zh-cn.js?t=I3I8 HTTP/1.1" 200 18822
WARNING 2021-12-29 13:56:20,778 log 222 Not Found: /templates/login.html
WARNING 2021-12-29 13:56:20,779 basehttp 124 "GET /templates/login.html HTTP/1.1" 404 2498
WARNING 2021-12-29 13:56:29,960 basehttp 124 "GET /static/index.html HTTP/1.1" 404 1654
INFO 2021-12-29 13:56:40,699 basehttp 124 "GET /static/detail.html HTTP/1.1" 200 8855
INFO 2021-12-29 13:56:40,718 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/prism/lib/prism/prism_patched.min.js HTTP/1.1" 200 99487
INFO 2021-12-29 13:56:40,722 basehttp 124 "GET /static/js/detail.js HTTP/1.1" 200 1294
INFO 2021-12-29 13:56:40,899 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/codesnippet/icons/codesnippet.png?t=I3I8 HTTP/1.1" 200 597
WARNING 2021-12-29 13:56:45,962 log 222 Not Found: /templates/login.html
WARNING 2021-12-29 13:56:45,963 basehttp 124 "GET /templates/login.html HTTP/1.1" 404 2498
INFO 2021-12-29 13:58:33,434 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 13:58:33,589 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 13:58:33,631 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 13:58:33,632 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 13:58:34,493 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 200 11818
INFO 2021-12-29 13:58:34,531 basehttp 124 "GET /static/img/5.png HTTP/1.1" 200 42633
INFO 2021-12-29 14:01:37,593 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
INFO 2021-12-29 14:01:39,113 basehttp 124 "GET /static/img/bizhi.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:08:08,408 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:08:08,534 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 14:08:08,571 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:08:08,573 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:28:19,560 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:28:19,682 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 14:28:19,720 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:28:19,722 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:28:20,981 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:28:22,363 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 14:28:22,391 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 14:36:16,915 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
ERROR 2021-12-29 14:36:25,292 basehttp 124 "POST /login/ HTTP/1.1" 500 59
ERROR 2021-12-29 14:36:38,400 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 14:36:49,542 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:36:49,638 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 14:36:49,672 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:36:54,574 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
ERROR 2021-12-29 14:37:00,843 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 14:40:17,272 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:40:17,417 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:40:21,869 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
ERROR 2021-12-29 14:40:33,666 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 14:40:50,241 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
ERROR 2021-12-29 14:41:01,497 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 14:43:30,849 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:43:30,955 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 14:43:35,081 basehttp 124 "GET /login/ HTTP/1.1" 200 2605
WARNING 2021-12-29 14:43:41,751 log 222 Forbidden (CSRF token missing or incorrect.): /login/
WARNING 2021-12-29 14:43:41,751 basehttp 124 "POST /login/ HTTP/1.1" 403 2508
WARNING 2021-12-29 14:43:54,361 log 222 Forbidden (CSRF token missing or incorrect.): /login/
WARNING 2021-12-29 14:43:54,361 basehttp 124 "POST /login/ HTTP/1.1" 403 2508
INFO 2021-12-29 14:45:02,437 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:45:02,558 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:45:06,455 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
WARNING 2021-12-29 14:45:16,503 log 222 Bad Request: /login/
WARNING 2021-12-29 14:45:16,503 basehttp 124 "POST /login/ HTTP/1.1" 400 30
ERROR 2021-12-29 14:45:25,194 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 14:59:13,760 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 14:59:13,848 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 14:59:13,882 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:59:13,884 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 14:59:19,960 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
WARNING 2021-12-29 14:59:26,886 log 222 Bad Request: /login/
WARNING 2021-12-29 14:59:26,886 basehttp 124 "POST /login/ HTTP/1.1" 400 24
WARNING 2021-12-29 15:00:03,936 log 222 Bad Request: /login/
WARNING 2021-12-29 15:00:03,936 basehttp 124 "POST /login/ HTTP/1.1" 400 24
WARNING 2021-12-29 15:01:02,244 log 222 Bad Request: /login/
WARNING 2021-12-29 15:01:02,244 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 15:01:05,262 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
WARNING 2021-12-29 15:01:11,531 log 222 Bad Request: /login/
WARNING 2021-12-29 15:01:11,532 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 15:08:00,698 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:08:00,749 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 15:08:03,875 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
INFO 2021-12-29 15:14:24,537 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:14:24,673 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:14:24,675 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:14:30,300 basehttp 124 "GET /register/ HTTP/1.1" 200 4187
WARNING 2021-12-29 15:14:36,247 log 222 Not Found: /register/login.html
WARNING 2021-12-29 15:14:36,248 basehttp 124 "GET /register/login.html HTTP/1.1" 404 2495
INFO 2021-12-29 15:15:20,111 basehttp 124 "GET /register/ HTTP/1.1" 200 3438
INFO 2021-12-29 15:15:39,100 basehttp 124 "GET /register/ HTTP/1.1" 200 2929
INFO 2021-12-29 15:22:04,491 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:22:04,587 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 15:22:07,961 basehttp 124 "GET /register/ HTTP/1.1" 200 2911
INFO 2021-12-29 15:22:53,240 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:22:55,936 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
INFO 2021-12-29 15:22:59,691 basehttp 124 "GET /register/ HTTP/1.1" 200 2911
INFO 2021-12-29 15:23:57,898 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:24:10,436 basehttp 124 "GET /register/ HTTP/1.1" 200 2911
INFO 2021-12-29 15:34:12,847 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
WARNING 2021-12-29 15:34:20,317 log 222 Bad Request: /login/
WARNING 2021-12-29 15:34:20,317 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 15:34:58,644 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:34:58,747 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 15:34:58,794 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:34:58,801 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:35:05,401 basehttp 124 "GET /login/ HTTP/1.1" 200 2744
WARNING 2021-12-29 15:35:13,659 log 222 Bad Request: /login/
WARNING 2021-12-29 15:35:13,660 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 15:35:25,409 basehttp 124 "GET /register/ HTTP/1.1" 200 3053
INFO 2021-12-29 15:51:45,634 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:51:45,753 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 15:51:45,784 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:51:45,785 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 15:51:50,551 basehttp 124 "GET /register/ HTTP/1.1" 200 3053
INFO 2021-12-29 15:53:56,502 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 15:54:01,650 basehttp 124 "GET /register/ HTTP/1.1" 200 3053
INFO 2021-12-29 16:03:17,141 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:03:23,844 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:03:29,400 basehttp 124 "GET /register/ HTTP/1.1" 200 3053
INFO 2021-12-29 16:07:13,980 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:07:14,099 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 16:07:14,137 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 16:07:18,208 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 16:07:19,460 basehttp 124 "GET /static/img/bizhi.jpg HTTP/1.1" 304 0
WARNING 2021-12-29 16:07:25,082 log 222 Bad Request: /login/
WARNING 2021-12-29 16:07:25,083 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 16:07:34,405 basehttp 124 "GET /register/ HTTP/1.1" 200 2969
INFO 2021-12-29 16:08:39,465 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:08:44,412 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 16:09:16,846 log 222 Bad Request: /login/
WARNING 2021-12-29 16:09:16,848 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 16:09:34,209 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 16:12:27,227 log 222 Bad Request: /login/
INFO 2021-12-29 16:13:35,032 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:13:35,130 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 16:13:40,090 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 16:14:07,355 log 222 Bad Request: /login/
WARNING 2021-12-29 16:14:07,357 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 16:14:22,890 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 16:20:53,902 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:20:58,140 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 16:21:05,294 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 16:21:30,368 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:21:34,968 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 16:21:40,866 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 16:24:35,773 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:24:35,887 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 16:24:35,923 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 16:24:42,325 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 16:24:46,896 log 222 Bad Request: /login/
WARNING 2021-12-29 16:24:46,897 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 16:31:18,747 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 16:31:20,722 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:31:39,527 basehttp 124 "GET /static/write_blog.html HTTP/1.1" 304 0
INFO 2021-12-29 16:31:39,551 basehttp 124 "GET /static/js/write_blog.js HTTP/1.1" 200 521
INFO 2021-12-29 16:31:39,618 basehttp 124 "GET /static/ckeditor/ckeditor/lang/zh-cn.js?t=I3I8 HTTP/1.1" 304 0
INFO 2021-12-29 16:31:43,286 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 16:31:43,307 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 16:31:55,650 basehttp 124 "GET /static/detail.html HTTP/1.1" 304 0
INFO 2021-12-29 16:31:55,667 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/prism/lib/prism/prism_patched.min.js HTTP/1.1" 304 0
INFO 2021-12-29 16:31:55,672 basehttp 124 "GET /static/js/detail.js HTTP/1.1" 304 0
INFO 2021-12-29 16:31:55,833 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/codesnippet/icons/codesnippet.png?t=I3I8 HTTP/1.1" 304 0
INFO 2021-12-29 16:33:09,797 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:33:45,556 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 16:33:45,594 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 17:32:20,204 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 17:32:20,300 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 17:32:20,329 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 17:32:20,331 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 17:32:24,219 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:32:33,643 basehttp 124 "POST /login/ HTTP/1.1" 500 59
WARNING 2021-12-29 17:33:08,342 log 222 Bad Request: /login/
WARNING 2021-12-29 17:33:08,342 basehttp 124 "POST /login/ HTTP/1.1" 400 24
INFO 2021-12-29 17:35:16,820 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:35:49,739 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 17:36:09,566 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 17:36:14,985 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:36:20,975 basehttp 124 "POST /login/ HTTP/1.1" 500 59
INFO 2021-12-29 17:41:23,629 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:41:29,756 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 135, in _get_response
raise ValueError(
ValueError: The view users.views.LoginView didn't return an HttpResponse object. It returned None instead.
ERROR 2021-12-29 17:41:29,757 basehttp 124 "POST /login/ HTTP/1.1" 500 65366
ERROR 2021-12-29 17:43:18,097 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 47, in post
user=mobile.check_password(password)
AttributeError: 'str' object has no attribute 'check_password'
ERROR 2021-12-29 17:43:18,099 basehttp 124 "POST /login/ HTTP/1.1" 500 83751
INFO 2021-12-29 17:43:20,175 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:43:25,773 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 47, in post
user=mobile.check_password(password)
AttributeError: 'str' object has no attribute 'check_password'
ERROR 2021-12-29 17:43:25,774 basehttp 124 "POST /login/ HTTP/1.1" 500 83751
INFO 2021-12-29 17:44:47,759 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 17:44:53,266 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 47, in post
user=User.check_password(password)
TypeError: check_password() missing 1 required positional argument: 'raw_password'
ERROR 2021-12-29 17:44:53,268 basehttp 124 "POST /login/ HTTP/1.1" 500 83785
INFO 2021-12-29 18:02:17,195 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:02:17,303 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 18:02:17,332 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:02:17,334 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:02:25,099 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:02:32,141 basehttp 124 "POST /login/ HTTP/1.1" 200 7
INFO 2021-12-29 18:03:05,950 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 18:03:12,558 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 135, in _get_response
raise ValueError(
ValueError: The view users.views.LoginView didn't return an HttpResponse object. It returned None instead.
ERROR 2021-12-29 18:03:12,559 basehttp 124 "POST /login/ HTTP/1.1" 500 65366
INFO 2021-12-29 18:03:50,126 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 18:03:55,614 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 135, in _get_response
raise ValueError(
ValueError: The view users.views.LoginView didn't return an HttpResponse object. It returned None instead.
ERROR 2021-12-29 18:03:55,615 basehttp 124 "POST /login/ HTTP/1.1" 500 65366
INFO 2021-12-29 18:04:26,277 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:04:31,751 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 18:04:36,825 log 222 Bad Request: /login/
WARNING 2021-12-29 18:04:36,825 basehttp 124 "POST /login/ HTTP/1.1" 400 30
INFO 2021-12-29 18:04:45,250 basehttp 124 "POST /login/ HTTP/1.1" 200 7
INFO 2021-12-29 18:05:35,078 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:05:40,030 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:05:46,084 basehttp 124 "POST /login/ HTTP/1.1" 200 7
INFO 2021-12-29 18:10:36,716 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:10:45,110 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:10:48,376 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:10:48,910 basehttp 124 "GET /static/img/bizhi.jpg HTTP/1.1" 304 0
ERROR 2021-12-29 18:10:55,005 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 135, in _get_response
raise ValueError(
ValueError: The view users.views.LoginView didn't return an HttpResponse object. It returned None instead.
ERROR 2021-12-29 18:10:55,006 basehttp 124 "POST /login/ HTTP/1.1" 500 65366
INFO 2021-12-29 18:11:37,749 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:11:55,972 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:12:01,359 basehttp 124 "POST /login/ HTTP/1.1" 200 2
INFO 2021-12-29 18:13:32,944 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:13:37,651 basehttp 124 "POST /login/ HTTP/1.1" 200 2
INFO 2021-12-29 18:13:50,223 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:13:55,214 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:14:00,707 basehttp 124 "POST /login/ HTTP/1.1" 200 2
INFO 2021-12-29 18:14:16,804 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:14:26,039 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:15:18,526 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:15:26,056 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:15:32,196 basehttp 124 "POST /login/ HTTP/1.1" 200 7
INFO 2021-12-29 18:16:57,659 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:17:02,013 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 18:17:09,201 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 34, in post
if not re.match(r'^1[3-9]\d{9}$', mobile):
File "c:\users\gll\appdata\local\programs\python\python38\lib\re.py", line 189, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
ERROR 2021-12-29 18:17:09,202 basehttp 124 "POST /login/ HTTP/1.1" 500 87759
INFO 2021-12-29 18:19:49,730 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:19:55,177 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 18:20:01,910 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 34, in post
if not re.match(r'^1[3-9]\d{9}$', mobile):
File "c:\users\gll\appdata\local\programs\python\python38\lib\re.py", line 189, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
ERROR 2021-12-29 18:20:01,911 basehttp 124 "POST /login/ HTTP/1.1" 500 87760
INFO 2021-12-29 18:20:22,231 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:20:28,586 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
ERROR 2021-12-29 18:20:33,918 log 222 Internal Server Error: /login/
Traceback (most recent call last):
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\GLL\Envs\blog\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "C:\Users\GLL\Desktop\webapp\6-315\blog\users\views.py", line 34, in post
if not re.match(r'^1[3-9]\d{9}$', mobile):
File "c:\users\gll\appdata\local\programs\python\python38\lib\re.py", line 189, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
ERROR 2021-12-29 18:20:33,919 basehttp 124 "POST /login/ HTTP/1.1" 500 87759
INFO 2021-12-29 18:21:03,090 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:21:07,470 basehttp 124 "POST /login/ HTTP/1.1" 200 18
INFO 2021-12-29 18:21:27,098 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:21:31,320 basehttp 124 "POST /login/ HTTP/1.1" 302 0
INFO 2021-12-29 18:21:31,324 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:21:59,862 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 18:21:59,894 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 18:26:16,756 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:26:18,120 basehttp 124 "GET / HTTP/1.1" 200 2742
INFO 2021-12-29 18:26:30,878 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:26:37,916 base 91 Method Not Allowed (POST): /
WARNING 2021-12-29 18:26:37,916 log 222 Method Not Allowed: /
WARNING 2021-12-29 18:26:37,916 basehttp 124 "POST / HTTP/1.1" 405 0
INFO 2021-12-29 18:27:24,307 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:27:30,651 log 222 Not Found: /index
WARNING 2021-12-29 18:27:30,652 basehttp 124 "GET /index HTTP/1.1" 404 2453
INFO 2021-12-29 18:28:33,397 basehttp 124 "GET / HTTP/1.1" 200 2742
INFO 2021-12-29 18:28:37,909 basehttp 124 "GET /index HTTP/1.1" 301 0
INFO 2021-12-29 18:28:37,925 basehttp 124 "GET /index/ HTTP/1.1" 200 4894
INFO 2021-12-29 18:28:37,956 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 18:29:01,086 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:29:05,856 base 91 Method Not Allowed (POST): /
WARNING 2021-12-29 18:29:05,856 log 222 Method Not Allowed: /
WARNING 2021-12-29 18:29:05,857 basehttp 124 "POST / HTTP/1.1" 405 0
INFO 2021-12-29 18:30:05,112 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:30:09,891 base 91 Method Not Allowed (POST): /
WARNING 2021-12-29 18:30:09,892 log 222 Method Not Allowed: /
WARNING 2021-12-29 18:30:09,892 basehttp 124 "POST / HTTP/1.1" 405 0
INFO 2021-12-29 18:30:36,099 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:30:43,075 base 91 Method Not Allowed (POST): /
WARNING 2021-12-29 18:30:43,075 log 222 Method Not Allowed: /
WARNING 2021-12-29 18:30:43,076 basehttp 124 "POST / HTTP/1.1" 405 0
INFO 2021-12-29 18:31:21,192 basehttp 124 "GET / HTTP/1.1" 200 2742
WARNING 2021-12-29 18:31:25,785 base 91 Method Not Allowed (POST): /
WARNING 2021-12-29 18:31:25,785 log 222 Method Not Allowed: /
WARNING 2021-12-29 18:31:25,786 basehttp 124 "POST / HTTP/1.1" 405 0
INFO 2021-12-29 18:35:45,704 basehttp 124 "GET / HTTP/1.1" 200 2742
INFO 2021-12-29 18:35:47,376 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:35:47,408 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:35:47,408 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:35:54,312 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:36:01,076 basehttp 124 "POST /login/ HTTP/1.1" 302 0
INFO 2021-12-29 18:36:01,083 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:36:06,379 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
WARNING 2021-12-29 18:38:01,364 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:38:01,371 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:40:24,548 basehttp 124 "GET /login/ HTTP/1.1" 200 2820
WARNING 2021-12-29 18:40:24,614 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:40:24,636 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:41:33,386 basehttp 124 "GET /login/ HTTP/1.1" 200 2824
WARNING 2021-12-29 18:41:33,449 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:41:33,468 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:41:33,838 basehttp 124 "GET /login/ HTTP/1.1" 200 2824
WARNING 2021-12-29 18:41:33,894 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:41:33,920 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:41:42,313 basehttp 124 "GET /login/ HTTP/1.1" 200 2824
WARNING 2021-12-29 18:41:42,361 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:41:42,390 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:41:55,055 basehttp 124 "GET /login/ HTTP/1.1" 200 2824
WARNING 2021-12-29 18:41:55,109 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:41:55,138 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:42:34,424 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
WARNING 2021-12-29 18:42:34,476 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:42:34,509 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:42:35,022 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
WARNING 2021-12-29 18:42:35,071 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:42:35,102 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:42:38,348 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:45,105 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:45,597 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:45,874 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:46,029 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:46,232 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:53,239 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:53,763 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:42:53,941 basehttp 124 "GET /login/ HTTP/1.1" 200 2928
INFO 2021-12-29 18:43:03,367 basehttp 124 "GET /login/ HTTP/1.1" 200 2742
INFO 2021-12-29 18:43:31,070 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:43:31,125 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:43:31,125 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 18:43:31,788 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:43:35,156 basehttp 124 "GET /login/ HTTP/1.1" 200 2719
INFO 2021-12-29 18:45:32,431 basehttp 124 "GET /login/ HTTP/1.1" 200 2505
INFO 2021-12-29 18:45:33,244 basehttp 124 "GET /login/ HTTP/1.1" 200 2505
INFO 2021-12-29 18:45:48,040 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:45:50,849 basehttp 124 "GET /login/ HTTP/1.1" 200 2459
INFO 2021-12-29 18:45:51,501 basehttp 124 "GET /login/ HTTP/1.1" 200 2459
INFO 2021-12-29 18:46:04,303 basehttp 124 "GET /login/ HTTP/1.1" 200 2423
WARNING 2021-12-29 18:46:08,728 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:46:08,737 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:46:28,537 basehttp 124 "GET /login/ HTTP/1.1" 200 2352
WARNING 2021-12-29 18:46:28,591 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:46:28,616 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:46:39,044 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
WARNING 2021-12-29 18:46:39,100 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:46:39,127 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:47:14,812 basehttp 124 "GET /login/ HTTP/1.1" 200 2380
WARNING 2021-12-29 18:47:14,873 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:47:14,888 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:47:54,570 basehttp 124 "GET /login/ HTTP/1.1" 200 2380
WARNING 2021-12-29 18:47:54,625 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:47:54,644 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:47:55,084 basehttp 124 "GET /login/ HTTP/1.1" 200 2380
WARNING 2021-12-29 18:47:55,139 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:47:55,167 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:48:22,686 basehttp 124 "GET /login/ HTTP/1.1" 200 2380
WARNING 2021-12-29 18:48:22,736 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:48:22,764 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:48:23,294 basehttp 124 "GET /login/ HTTP/1.1" 200 2380
WARNING 2021-12-29 18:48:23,349 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:48:23,385 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:48:33,839 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:48:39,152 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
WARNING 2021-12-29 18:48:39,209 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:48:39,231 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:48:45,093 basehttp 124 "GET /static/write_blog.html HTTP/1.1" 304 0
INFO 2021-12-29 18:48:45,115 basehttp 124 "GET /static/js/write_blog.js HTTP/1.1" 200 521
INFO 2021-12-29 18:48:45,191 basehttp 124 "GET /static/ckeditor/ckeditor/lang/zh-cn.js?t=I3I8 HTTP/1.1" 304 0
INFO 2021-12-29 18:48:49,808 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 18:48:49,829 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 18:48:57,108 basehttp 124 "GET /static/detail.html HTTP/1.1" 304 0
INFO 2021-12-29 18:48:57,128 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/prism/lib/prism/prism_patched.min.js HTTP/1.1" 304 0
INFO 2021-12-29 18:48:57,131 basehttp 124 "GET /static/js/detail.js HTTP/1.1" 304 0
INFO 2021-12-29 18:48:57,292 basehttp 124 "GET /static/ckeditor/ckeditor/plugins/codesnippet/icons/codesnippet.png?t=I3I8 HTTP/1.1" 304 0
INFO 2021-12-29 18:55:12,375 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:55:17,536 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
INFO 2021-12-29 18:55:23,184 basehttp 124 "POST /login/ HTTP/1.1" 302 0
INFO 2021-12-29 18:55:23,190 basehttp 124 "GET / HTTP/1.1" 200 4894
WARNING 2021-12-29 18:55:28,863 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:55:28,868 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:58:00,687 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
WARNING 2021-12-29 18:58:00,738 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:58:00,764 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 18:58:24,453 basehttp 124 "POST /login/ HTTP/1.1" 302 0
INFO 2021-12-29 18:58:24,463 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 18:58:24,487 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
WARNING 2021-12-29 18:58:24,512 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 18:58:24,539 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 19:58:49,200 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 19:58:49,300 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 19:58:49,346 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 19:58:49,348 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 19:58:52,931 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:52,954 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:52,956 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:52,958 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:52,962 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:52,967 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:52,970 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:52,971 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:52,973 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:52,973 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:52,973 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
WARNING 2021-12-29 19:58:52,975 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:52,978 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:52,979 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:52,979 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:54,627 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:54,628 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:54,634 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:54,636 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:54,638 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:54,638 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:54,643 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:54,643 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:54,647 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:54,647 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:54,656 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:54,656 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
INFO 2021-12-29 19:58:56,602 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:56,627 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:56,630 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:56,631 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:56,634 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:56,637 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:56,638 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:56,641 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:56,645 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:56,646 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:56,647 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:56,649 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:56,652 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:56,653 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:56,653 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
WARNING 2021-12-29 19:58:56,657 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:56,657 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
INFO 2021-12-29 19:58:57,095 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:57,119 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:57,121 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:57,123 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:57,123 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:57,125 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,126 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,129 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,134 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,138 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,140 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,140 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,143 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:57,144 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:57,144 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
INFO 2021-12-29 19:58:57,280 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:57,306 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:57,310 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:57,312 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,312 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:57,312 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:57,313 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,319 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,325 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,325 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,326 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,327 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,329 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:57,330 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:57,330 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
INFO 2021-12-29 19:58:57,458 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:57,479 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:57,479 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:57,483 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:57,484 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,485 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:57,485 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,492 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,494 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,495 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,496 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,497 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,503 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:57,503 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:57,505 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
INFO 2021-12-29 19:58:57,639 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:57,661 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:57,662 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:57,664 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,666 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:57,667 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,668 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:57,672 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,673 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,686 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,687 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,687 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,687 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,693 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,696 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:57,700 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:57,702 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,702 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
WARNING 2021-12-29 19:58:57,703 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,708 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,709 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,713 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,713 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
INFO 2021-12-29 19:58:57,910 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:58:57,938 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:58:57,940 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:58:57,941 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:58:57,943 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:58:57,944 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:58:57,945 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:58:57,947 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:58:57,953 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,954 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:58:57,960 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:58:57,960 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:58:57,962 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:58:57,962 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
WARNING 2021-12-29 19:58:57,963 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:58:57,967 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:58:57,969 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
INFO 2021-12-29 19:59:33,535 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 19:59:37,706 basehttp 124 "GET /register/ HTTP/1.1" 200 5131
WARNING 2021-12-29 19:59:37,732 log 222 Not Found: /register/js/vue-2.5.16.js
WARNING 2021-12-29 19:59:37,734 log 222 Not Found: /register/bootstrap/css/bootstrap.min.css
WARNING 2021-12-29 19:59:37,735 basehttp 124 "GET /register/js/vue-2.5.16.js HTTP/1.1" 404 2513
WARNING 2021-12-29 19:59:37,736 basehttp 124 "GET /register/bootstrap/css/bootstrap.min.css HTTP/1.1" 404 2558
WARNING 2021-12-29 19:59:37,738 log 222 Not Found: /register/js/axios-0.18.0.min.js
WARNING 2021-12-29 19:59:37,738 basehttp 124 "GET /register/js/axios-0.18.0.min.js HTTP/1.1" 404 2531
WARNING 2021-12-29 19:59:37,741 log 222 Not Found: /register/js/host.js
WARNING 2021-12-29 19:59:37,743 basehttp 124 "GET /register/js/host.js HTTP/1.1" 404 2495
WARNING 2021-12-29 19:59:37,745 log 222 Not Found: /register/js/common.js
WARNING 2021-12-29 19:59:37,749 basehttp 124 "GET /register/js/common.js HTTP/1.1" 404 2501
WARNING 2021-12-29 19:59:37,751 log 222 Not Found: /register/js/register.js
WARNING 2021-12-29 19:59:37,754 log 222 Not Found: /register/img/image_code.png
WARNING 2021-12-29 19:59:37,754 basehttp 124 "GET /register/js/register.js HTTP/1.1" 404 2507
WARNING 2021-12-29 19:59:37,755 basehttp 124 "GET /register/img/image_code.png HTTP/1.1" 404 2519
INFO 2021-12-29 20:13:30,191 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 20:13:31,536 basehttp 124 "GET / HTTP/1.1" 200 4818
INFO 2021-12-29 20:13:32,748 basehttp 124 "GET / HTTP/1.1" 200 4818
INFO 2021-12-29 20:26:56,921 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 20:27:00,509 basehttp 124 "GET /register/ HTTP/1.1" 200 5039
INFO 2021-12-29 20:27:00,526 basehttp 124 "GET /static/img/image_code.png HTTP/1.1" 200 3483
INFO 2021-12-29 20:38:34,572 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 20:38:34,641 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 20:38:34,673 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 20:46:50,245 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 20:46:50,457 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 21:00:02,534 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 21:00:05,322 basehttp 124 "GET /register/ HTTP/1.1" 200 5025
WARNING 2021-12-29 21:00:05,349 log 222 Not Found: /register/image_code_url
WARNING 2021-12-29 21:00:05,350 basehttp 124 "GET /register/image_code_url HTTP/1.1" 404 3303
WARNING 2021-12-29 21:00:06,161 log 222 Not Found: /register/image_code_url
WARNING 2021-12-29 21:00:06,162 basehttp 124 "GET /register/image_code_url HTTP/1.1" 404 3303
INFO 2021-12-29 21:01:08,707 basehttp 124 "GET /imagecode/?uuid=123 HTTP/1.1" 200 3534
INFO 2021-12-29 21:01:50,619 basehttp 124 "GET /imagecode?uuid=123 HTTP/1.1" 301 0
INFO 2021-12-29 21:24:14,239 basehttp 124 "GET /register/ HTTP/1.1" 200 4268
INFO 2021-12-29 21:32:02,572 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 21:32:02,654 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 21:32:02,702 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 21:32:04,215 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 21:32:04,239 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 21:32:14,472 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
INFO 2021-12-29 21:32:15,545 basehttp 124 "GET /static/img/bizhi.jpg HTTP/1.1" 304 0
INFO 2021-12-29 21:32:20,771 basehttp 124 "GET /register/ HTTP/1.1" 200 4250
INFO 2021-12-29 21:59:47,938 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 21:59:48,061 basehttp 124 "GET /static/img/22.jpg HTTP/1.1" 304 0
INFO 2021-12-29 21:59:51,521 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
INFO 2021-12-29 21:59:54,616 basehttp 124 "GET /register/ HTTP/1.1" 200 4394
INFO 2021-12-29 22:02:10,051 basehttp 124 "GET /register/ HTTP/1.1" 200 3629
INFO 2021-12-29 22:02:47,544 basehttp 124 "GET /register/ HTTP/1.1" 200 4394
WARNING 2021-12-29 22:02:59,511 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 22:02:59,528 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 22:08:34,215 basehttp 124 "GET /register/ HTTP/1.1" 200 2551
WARNING 2021-12-29 22:08:34,277 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 22:08:34,289 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
INFO 2021-12-29 22:09:22,972 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:09:23,024 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 22:09:23,043 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
WARNING 2021-12-29 22:09:53,530 log 222 Bad Request: /register/
WARNING 2021-12-29 22:09:53,532 basehttp 124 "POST /register/ HTTP/1.1" 400 18
INFO 2021-12-29 22:10:30,614 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:10:49,872 log 222 Bad Request: /register/
WARNING 2021-12-29 22:10:49,874 basehttp 124 "POST /register/ HTTP/1.1" 400 12
INFO 2021-12-29 22:13:53,889 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:14:30,376 log 222 Bad Request: /register/
WARNING 2021-12-29 22:14:30,380 basehttp 124 "POST /register/ HTTP/1.1" 400 12
INFO 2021-12-29 22:15:19,108 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:15:30,320 log 222 Bad Request: /register/
WARNING 2021-12-29 22:15:30,324 basehttp 124 "POST /register/ HTTP/1.1" 400 12
INFO 2021-12-29 22:21:49,702 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 22:21:49,795 basehttp 124 "GET /static/common/zhan.css HTTP/1.1" 304 0
INFO 2021-12-29 22:21:49,829 basehttp 124 "GET /static/img/9.jpg HTTP/1.1" 304 0
INFO 2021-12-29 22:21:51,232 basehttp 124 "GET /static/wenzhang.html HTTP/1.1" 304 0
INFO 2021-12-29 22:21:51,261 basehttp 124 "GET /static/img/5.png HTTP/1.1" 304 0
INFO 2021-12-29 22:21:57,194 basehttp 124 "GET /login/ HTTP/1.1" 200 2421
INFO 2021-12-29 22:22:03,683 basehttp 124 "POST /login/ HTTP/1.1" 302 0
INFO 2021-12-29 22:22:03,690 basehttp 124 "GET / HTTP/1.1" 200 4894
INFO 2021-12-29 22:22:50,582 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:22:50,665 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 22:22:50,679 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
WARNING 2021-12-29 22:22:56,136 log 222 Bad Request: /register/
WARNING 2021-12-29 22:22:56,137 basehttp 124 "POST /register/ HTTP/1.1" 400 12
INFO 2021-12-29 22:23:22,310 basehttp 124 "GET /register/ HTTP/1.1" 200 2541
WARNING 2021-12-29 22:23:22,378 basehttp 124 "GET /static/js/axios.min.map HTTP/1.1" 404 1672
INFO 2021-12-29 22:23:22,397 basehttp 124 "GET /static/bootstrap/css/bootstrap.min.css.map HTTP/1.1" 200 562427
WARNING 2021-12-29 22:23:35,421 log 222 Bad Request: /register/
WARNING 2021-12-29 22:23:35,423 basehttp 124 "POST /register/ HTTP/1.1" 400 12

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -15,15 +15,3 @@ function get_query_string(name) {
}
// 生成uuid
function generateUUID() {
var d = new Date().getTime();
if(window.performance && typeof window.performance.now === "function"){
d += performance.now(); //use high-precision timer if available
}
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid;
}

View File

@ -7,7 +7,7 @@ var vm = new Vue({
show_menu:false,
mobile:'',
password:'',
remembered:'',
},
mounted(){

View File

@ -6,163 +6,28 @@ var vm = new Vue({
host,
show_menu:false,
mobile:'',
mobile_error:false,
mobile_error_message:'手机号错误',
password:'',
password_error:false,
password_error_message:'密码错误',
password2:'',
password2_error:false,
password2_error_message:'密码不一致',
uuid:'',
image_code:'',
image_code_error:false,
image_code_error_message:'图片验证码错误',
sms_code:'',
sms_code_error:false,
sms_code_error_message:'短信验证码错误',
sms_code_message:'点击获取验证码',
sending_flag:false,
image_code_url:''
},
mounted(){
this.generate_image_code()
},
methods: {
//显示下拉菜单
show_menu_click:function(){
this.show_menu = !this.show_menu ;
},
generateUUID: function () {
var d = new Date().getTime();
if (window.performance && typeof window.performance.now === "function") {
d += performance.now(); //use high-precision timer if available
}
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
},
// 生成一个图片验证码的编号并设置页面中图片验证码img标签的src属性
generate_image_code: function () {
// 生成一个编号 : 严格一点的使用uuid保证编号唯一 不是很严谨的情况下,也可以使用时间戳
this.uuid = this.generateUUID();
// 设置页面中图片验证码img标签的src属性
this.image_code_url = this.host + "/imagecode/?uuid=" + this.uuid;
},
//检查手机号
check_mobile: function(){
var re = /^1[3-9]\d{9}$/;
if (re.test(this.mobile)) {
this.mobile_error = false;
} else {
this.mobile_error = true;
}
check_mobile:function () {
},
//检查密码
check_password:function () {
var re = /^[0-9A-Za-z]{8,20}$/;
if (re.test(this.password)) {
this.password_error = false;
} else {
this.password_error = true;
}
check_mobile:function () {
},
//检查确认密码
check_password2:function () {
if (this.password != this.password2) {
this.password2_error = true;
} else {
this.password2_error = false;
}
},
//检查验证码
check_image_code:function () {
if (!this.image_code) {
this.image_code_error = true;
} else {
this.image_code_error = false;
}
},
//检查短信验证码
check_sms_code:function () {
if (!this.sms_code) {
this.sms_code_error = true;
} else {
this.sms_code_error = false;
}
},
//发送短信验证码
send_sms_code:function () {
if (this.sending_flag == true) {
return;
}
this.sending_flag = true;
// 校验参数,保证输入框有数据填写
this.check_mobile();
this.check_image_code();
if (this.mobile_error == true || this.image_code_error == true) {
this.sending_flag = false;
return;
}
// 向后端接口发送请求,让后端发送短信验证码
var url = this.host + '/smscode/?mobile=' + this.mobile + '&image_code=' + this.image_code + '&uuid=' + this.uuid;
axios.get(url, {
responseType: 'json'
})
.then(response => {
// 表示后端发送短信成功
if (response.data.code == '0') {
// 倒计时60秒60秒后允许用户再次点击发送短信验证码的按钮
var num = 60;
// 设置一个计时器
var t = setInterval(() => {
if (num == 1) {
// 如果计时器到最后, 清除计时器对象
clearInterval(t);
// 将点击获取验证码的按钮展示的文本回复成原始文本
this.sms_code_message = '获取短信验证码';
// 将点击按钮的onclick事件函数恢复回去
this.sending_flag = false;
} else {
num -= 1;
// 展示倒计时信息
this.sms_code_message = num + '秒';
}
}, 1000, 60)
} else {
if (response.data.code == '4001') {
//图片验证码错误
this.image_code_error = true;
}
this.sms_code_error = true;
this.generate_image_code();
this.sending_flag = false;
}
})
.catch(error => {
console.log(error.response);
this.sending_flag = false;
})
},
//提交
on_submit:function () {
this.check_mobile();
this.check_password();
this.check_password2();
this.check_sms_code();
if (this.mobile_error == true || this.password_error == true || this.password2_error == true
|| this.image_code_error == true || this.sms_code_error == true) {
// 不满足注册条件:禁用表单
window.event.returnValue = false;
}
}
}
});
});

View File

@ -77,7 +77,7 @@
<!-- 文章内容 -->
<!-- 标题图 -->
<div class="col-3">
<img src="img/1.jpg" alt="avatar" style="max-width:100%; border-radius: 20px">
<img src="img/5.png" alt="avatar" style="max-width:100%; border-radius: 20px">
</div>
<div class="col">
<!-- 栏目 -->
@ -248,12 +248,7 @@
</div>
</div>
<!-- Footer -->
<footer class="py-3 bg-dark" id="footer">
<div class="container">
<h5 class="m-0 text-center text-white">Copyright @ qiruihua</h5>
</div>
</footer>
</div>
<!-- 引入js -->

View File

@ -38,14 +38,13 @@
</nav>
<!--content-->
<div class="container" style="height: 600px;margin-top: 20px">
<div class="row" >
<div class="col-12">
<div class="col-6">
<form class="login" id="login_form" method="POST" style="padding-right: 200px;margin-left: -100px">
{% csrf_token %}
<div class="form-group">
<label for="id_login">账号: </label>
<input type="text" name="mobile" placeholder="请输入手机号" autofocus="autofocus" required id="id_login" class="form-control" v-model="mobile" @blur="check_mobile"/>
@ -53,15 +52,11 @@
<div class="form-group mb-1">
<label for="id_password">密码:</label>
<input type="password" name="password" placeholder="请输入密码" required id="id_password" class="form-control" v-model="password" @blur="check_password"/>
</div>
<div class="custom-control custom-checkbox mb-2">
<input type="checkbox" name="remember" id="id_remember" checked class="custom-control-input" v-model="remembered"/>
</div>
<button class="primaryAction btn btn-primary" type="submit" id="submit_login" @click="on_submit">登录</button>
</form>
</div>
</div>
</div>
</div>

View File

@ -7,6 +7,7 @@
<meta charset="utf-8">
<!-- 网站标题 -->
<title>注册</title>
<!-- 引入bootstrap的css文件 -->
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css">
<!-- 引入vuejs -->
@ -22,14 +23,14 @@
<div class="container">
<!-- 导航栏商标 -->
<div>
<a class="navbar-brand" href="index.html">个人博客</a>
<a class="navbar-brand" href="./index.html">个人博客</a>
</div>
</div>
<!--登录/个人中心-->
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link" href="login.html">登录</a>
<a class="nav-link" href="./login.html">登录</a>
</li>
</ul>
</div>
@ -37,58 +38,35 @@
<!--content-->
<div class="container" style="height: 600px;margin-top: 20px">
<div class="row" >
<div class="col-12">
<div class="col-6">
<form class="login" id="login_form" method="POST">
<!--手机号-->
<div class="form-group">
<label >手机号: </label>
<div class="col-lg-6">
<input type="text" name="mobile" placeholder="请输入手机号" autofocus="autofocus" required
id="id_login" class="form-control" v-model="mobile" />
</div>
<small class="form-text text-muted ml-1" v-show="mobile_error" >[[mobile_error_message]]</small>
</div>
<!--密码-->
<div class="form-group">
<label >密码:</label>
<div class="col-lg-6">
<input type="password" name="password" placeholder="请输入密码" required class="form-control" v-model="password" @blur="check_password" />
</div>
<small class="form-text text-muted ml-1" v-show="password_error" >[[password_error_message]]</small>
</div>
<!--确认密码-->
<div class="form-group">
<label >确认密码:</label>
<div class="col-lg-6">
<input type="password" name="password2" placeholder="请输入确认密码" required class="form-control" v-model="password2" @blur="check_password2"/>
</div>
<small class="form-text text-muted ml-1" v-show="password2_error" >[[password2_error_message]]</small>
</div>
<!--短信验证码-->
<div class="col-6">
<form class="login" id="login_form" method="POST" style="padding-right: 200px;margin-left: -100px">
{% csrf_token %}
<div class="form-group">
<label >短信验证码:</label>
<div class="row" style="margin-right:5px;margin-left:0px">
<div class="col-lg-6">
<input type="text" name="sms_code" placeholder="请输入短信验证码" required class="form-control" v-model="sms_code" @blur="check_sms_code"/>
</div>
<span class="primaryAction btn btn-primary" @click="send_sms_code">[[sms_code_message]]</span>
<small class="form-text text-muted ml-1" v-show="sms_code_error" >[[sms_code_error_message]]</small>
</div>
</div>
<button class="primaryAction btn btn-primary" type="submit" id="submit_login" @click="on_submit">注册</button>
<label for="id_login">账号: </label>
<input type="text" name="mobile" placeholder="请输入手机号" autofocus="autofocus" required id="id_login" class="form-control" v-model="mobile" @blur="check_mobile"/>
</div>
<div class="form-group mb-1">
<label for="id_password">密码:</label>
<input type="password" name="password" placeholder="请输入密码" required id="id_password" class="form-control" v-model="password" @blur="check_password"/>
</div>
<button class="primaryAction btn btn-primary" type="submit" id="submit_login" @click="on_submit">登录</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
</div>
<!-- 引入js -->
<script type="text/javascript" src="../static/js/host.js"></script>
<script type="text/javascript" src="../static/js/common.js"></script>
<script type="text/javascript" src="../static/js/register.js"></script>
<script type="text/javascript" src="../static/js/login.js"></script>
</body>
</html>

View File

@ -0,0 +1,45 @@
# Generated by Django 2.1.1 on 2021-12-29 06:56
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('mobile', models.CharField(blank=True, max_length=20, unique=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': '用户信息',
'verbose_name_plural': '用户信息',
'db_table': 'tb_user',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

View File

@ -1,3 +1,26 @@
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
# 电话号码字段
# unique 为唯一性字段
mobile = models.CharField(max_length=20, unique=True,blank=True)
USERNAME_FIELD = 'mobile'
#创建超级管理员的需要必须输入的字段
REQUIRED_FIELDS = ['username','email']
class Meta:
db_table='tb_user' #修改默认的表名
verbose_name='用户信息' # Admin后台显示
verbose_name_plural=verbose_name # Admin后台显示
def __str__(self):
return self.mobile

View File

@ -9,4 +9,5 @@ urlpatterns = [
# 参数3路由名方便通过reverse来获取路由
path('register/',RegisterView.as_view(),name='register'),
path('login/',LoginView.as_view(),name='login'),
]

View File

@ -1,12 +1,46 @@
from django.shortcuts import render
from django.http import HttpResponseBadRequest, HttpResponse,HttpResponseRedirect
from django.shortcuts import render, redirect
from django.contrib.auth import login
import re
from users.models import User
from django.db import DatabaseError
from django.contrib.auth import authenticate
# Create your views here.
from django.urls import reverse
from django.views import View
#注册试图
class RegisterView(View):
def get(self,request):
return render(request,'register.html')
def post(self, request):
# 接收参数
mobile = request.POST.get('mobile')
password = request.POST.get('password')
# 判断参数是否齐全
# if not all([mobile, password]):
# return HttpResponseBadRequest('缺少必传参数')
# # 判断手机号是否合法
# if not re.match(r'^1[3-9]\d{9}$', mobile):
# return HttpResponseBadRequest('请输入正确的手机号码')
# # 判断密码是否是8-20个数字
# if not re.match(r'^[0-9A-Za-z]{8,20}$', password):
# return HttpResponseBadRequest('请输入8-20位的密码')
# 判断两次密码是否一致
# 保存注册数据
try:
user = User.objects.create_user(username=mobile, mobile=mobile, password=password)
except DatabaseError:
return HttpResponseBadRequest('注册失败')
# 响应注册结果
return HttpResponse('注册成功,重定向到首页')
@ -14,6 +48,46 @@ class LoginView(View):
def get(self,request):
return render(request,'login.html')
def post(self, request):
# 接受参数
mobile = request.POST.get('mobile')
password = request.POST.get('password')
# 校验参数
# 判断参数是否齐全
if not all([mobile, password]):
return HttpResponseBadRequest('缺少必传参数')
# 判断手机号是否正确
if not re.match(r'^1[3-9]\d{9}$', mobile):
return HttpResponseBadRequest('请输入正确的手机号')
# 判断密码是否是8-20个数字
if not re.match(r'^[0-9A-Za-z]{8,20}$', password):
return HttpResponseBadRequest('密码最少8位最长20位')
# 认证登录用户
# 认证字段已经在User模型中的USERNAME_FIELD = 'mobile'修改
#
if int(mobile)==18368421420 and int(password) ==123456789:
# 返回响应
return HttpResponseRedirect('/')
else:
return HttpResponse('账号密码错误')
# 设置状态保持的周期
# 记住用户None表示两周后过期