错误记录
爬山的小明
天道酬勤
展开
-
django开发错误记录之NoReverseMatch: Reverse for 'list' not found. 'list' is not a valid view function or p
之前列表页功能写好后,需要优化.就改了视图函数,url.后来报错误,以为是路由写的有问题,或者视图函数有问题.找了几小时,后来发现是模板里的url解析有个地方没改过来. <li><a title="销量" href="{% url 'list:all' %}?page={{ shop_list.number }}&price={{ price }}&am...原创 2019-02-16 11:49:42 · 2169 阅读 · 0 评论 -
开发错误记录之Model class main.models.Navigation doesn't declare an explicit app_label and isn't in an app
之前遇到了2次这个错误Model class main.models.Navigation doesn’t declare an explicit app_label and isn’t in an app其实解决办法很简单,就是将import的路径写成绝对路径就ok.比如,将from main.models import User 改成 from apps.main.models import...原创 2019-02-18 13:58:15 · 5324 阅读 · 0 评论 -
django开发错误记录之django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicat
django.core.exceptions.ImproperlyConfigured: Application labels aren’t unique, duplicates: auth真是难受,字面意思就是auth模块已存在.原因是用pycharm创建应用时自动创建了一个叫’django.contrib.auth’.删掉就行...原创 2019-02-20 11:50:26 · 764 阅读 · 0 评论