1、django.db.utils.OperationalError: no such table: app_province

解决方法就是   写完models就执行migrations,migrate

根据这人说的我就先创建表表创建好了才写代码就没问题了

Django报错


2、

TypeError: argument of type 'function' is not iterable

url(r'^test/$',test,name='test'),

name后面忘加双引号

3、__init__() got an unexpected keyword argument 'mimetype'

django1.7以上版本不在写 mimetype 了,需把mimetype改为content_type


4、Forbidden (CSRF token missing or incorrect.): 

我这里的情况:

settings.py:

'django.middleware.csrf.CsrfViewMiddleware',

html

{% csrf_token %}
views.py
return render_to_response('test.html', locals())

这些内容都是有的

但是点击提交的按钮,一直报错

处理方法:

忘了在哪看到的,说要接受request请求才可以,我就尝试了下面的写法,果然解决了

return render(request,'test.html', locals())





Django报错

转载于:https://blog.51cto.com/10983441/1884022

相关文章:

  • 2022-02-22
  • 2021-06-21
  • 2021-09-14
  • 2021-09-27
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-10-03
相关资源
相似解决方案