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 re
direct to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/carts/user/cart/ (note the t
railing slash), or set APPEND_SLASH=False in your Django settings.
翻译后:
RuntimeError:您通过POST调用了这个URL,但是URL不是以斜杠结尾,并且您设置了append_斜杠。Django不能重新
在维护POST数据时直接指向斜杠URL。将表单更改为127.0.0.1:8000/购物车/user/cart/(注意t
或者在Django设置中设置APPEND_SLASH=False。
1.代码运行 时碰到这样的错误
从翻译来看实url地址错误
我自己这样解决的把自己路由的地址最后一个 ‘/’ 去掉就好了
2.网上还有另一种方法(没试过)
或者修改settings:APPEND_SLASH=False.