Django项目使用postman测试post请求时候出现报错解决
问题描述——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 127.0.0.1:8000/film/register/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
问题原因
错误分析:
因为定义的是post请求,pots请求一般是要携带参数进行提交,后面表单验证,但是测试没有写表单验证数据,只有一个post请,这个时候要给url地址