Django出现的错误1.TypeError: view must be a callable or a list/tuple in the case of include().1.TypeError: view must be a callable or a list/tuple in the case of include().
.TypeError: view must be a callable or a list/tuple in the case of include().
原因:
url(r"^uploads/(?P<path>.*)$", 'django.views.static.serve', {"document_root": settings.MEDIA_ROOT}),
这种写法是Django1.10之前的写法。1.10之后的写法是这样的
from django.views.static import serve
url(r"^uploads/(?P<path>.*)$", serve, {"document_root": settings.MEDIA_ROOT}),
.ERRORS:?: (urls.E006) The MEDIA_URL setting must end with a slash. System check identified issue ( silenced).
原因:这是因为MEDIA_URL = 'uploads'没有‘/’
解决:
MEDIA_URL = '/uploads/'
.Dependency on app with no migrations: blog
解决办法:
python2 manage.py makemigrations
本文摘自:https://my.oschina.net/u/3298130/blog/1635053
Django出现的错误1.TypeError: view must be a callable or a list/tuple in the case of include().1.TypeError: view must be a callable or a list/tuple in the case of include().的更多相关文章
- django中出现 错误 Errno 10053
django中出现 错误 Errno 10053 pycharm里出现下面错误File "C:\Python27\lib\socket.py", line 307, in flus ...
- Django学习——collectstatic错误
Error fetching command 'collectstatic': You're using the staticfiles app without having set the STAT ...
- Django Forms的错误提示
1.error_messages={} 首先,在构建form表单时,可以用"error_messages={}"自定义错误信息,例如: # form.py 1 from djang ...
- Django笔记-常见错误整理
1.csrf错误 解决方法:在settings.py里注释掉相关内容即可 MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.Sess ...
- Django中csrf错误
CSRF(Cross-site request forgery)跨站请求伪造,也被称为“one click attack”或者session riding,通常缩写为CSRF或者XSRF,是一种对网站 ...
- django http 403 错误
在使用android的xUtils框架提交post请求到django服务器上面,出现错误,返回Forbiddeen.解决方法记录于此. 参考链接 http://blog.csdn.net/liangp ...
- django插入数据库错误:mysql的1267错误
错误信息: django.db.utils.OperationalError: (1267, "Illegal mix of collations (latin1_swedish_ci,IM ...
- django之异常错误2(Error was: No module named sqlite3.base)
具体错误代码为: C:\djangoweb\helloworld>manage.py syncdbTraceback (most recent call last): File "C ...
- Django用户名密码错误提示
from django.shortcuts import render # Create your views here. from django.shortcuts import render fr ...
随机推荐
- 微信小程序 - video组件poster无效 / 视频播放列表
在做有关微信小程序有关视频播放页面的时候,遇到video组件设置poster无效果,然后查了下poster属性:视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 pos ...
- CentOS7下python工作环境管理
一.pyenv管理不同的python版本1.下载安装git clone git://github.com/yyuu/pyenv.git ~/.pyenv echo 'export PYENV_ROO ...
- 【笔试题】Java 易错题精选
笔试题 Java 易错题精选 1.写出下列程序的运行结果( )String 不变性Java 值传递 public class Test { public static void main(String ...
- str 编码
你需要的是让编码用实际编码而不是 ascii 1 对需要 str->unicode 的代码,可以在前边写上 import sys reload(sys) sys.setdefault ...
- Sqli-labs less 12
Less-12 本关和less11是类似的,只是在id 的参数的处理上有一定的不同 当输入username:admin" Password: (随便) 报错后的结果为: You have a ...
- 【Leetcode】264. Ugly Number II ,丑数
原题 Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime facto ...
- WebService数据示例
通过webservice提交xml数据以及soap协议的使用 上次已经给大家分享了简单的webservice的使用,提交给服务器的数据只是简单类型的数据,这次呢换成了xml,并通过一个小例子来讲解so ...
- [Lydsy1806月赛] 质数拆分
(mmp我已经不知道是第几次写NTT被卡了) 可以发现质数个数是 N/log(N) 级别的,1.5*10^5之内也只有 10000 多一点质数. 所以我们第一层暴力卷积,常数可以优化成 1/2. 然后 ...
- 【状压DP】BZOJ2734-[HNOI2012]集合选数
已经八月份了药丸,开始肝作业并且准备高考啦!! [题目大意] <集合论与图论>这门课程有一道作业题,要求同学们求出{1, 2, 3, 4, 5}的所有满足以 下条件的子集:若 x 在该子集 ...
- 交换x,y的三种方式
1 值传递: #include<iostream> using namespace std; int main(){ void change(int ,int); int x=2,y=3; ...