其他分享
首页 > 其他分享> > Django提交时报错

Django提交时报错

作者:互联网

错误描述:

RuntimeError at /saveBlog
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 localhost:8000/saveBlog/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
大意是:在POST调用URL时,在URL末尾没有“/”。

解决方法:
在Form的action属性中的url尾加上“/”:
...
<form action='/saveBlog/' method='post'>
...
</form>

标签:提交,时报,URL,Django,set,slash,POST,your
来源: https://www.cnblogs.com/i-am-sailing/p/13961060.html