Django做input表单提交报错,错误信息如下
RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set. Django can’t redirect to the slash URL while maintaining POST data. Change your form to point to 192.168.169.2/logo/upload/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
错误处理
修改 urls路由,去除尾部的“/”
原: url(r’^logo/upload/
′
,
c
o
n
f
i
g
v
i
e
w
s
.
u
p
l
o
a
d
)
修
改
后
:
u
r
l
(
r
′
l
o
g
o
/
u
p
l
o
a
d
',configviews.upload) 修改后:url(r'^logo/upload
′,configviews.upload)修改后:url(r′logo/upload’,configviews.upload)