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 ...
随机推荐
- 深度学习方法(五):卷积神经网络CNN经典模型整理Lenet,Alexnet,Googlenet,VGG,Deep Residual Learning
欢迎转载,转载请注明:本文出自Bin的专栏blog.csdn.net/xbinworld. 技术交流QQ群:433250724,欢迎对算法.技术感兴趣的同学加入. 关于卷积神经网络CNN,网络和文献中 ...
- PHP PDO类
<?php //数据库连接类,不建议直接使用DB,而是对DB封装一层 //这个类不会被污染,不会被直接调用 class DB { //pdo对象 private $_pdo = null; // ...
- vue2.0使用watch监听对象属性
二话不说直接代码,找了一个百度都没找到.... var head=new Vue({ data:{ checkBoxState:{//监听设置开关勾选状态 notice:true, sound:tru ...
- centos7.5英文环境切换到中文环境,再切回中文环境后 ,terminal不能用
1.查看系统日志 less /var/logs/message May 12 21:54:41 localhost python: SELinux is preventing /usr/libexec ...
- LoadRunner读取文件并验证
checkprocess() { char command[1024]; int i, total = 0; char buffer[12], ch; char *filen ...
- 常用的phpstorm快捷键总结(带截屏版)
常用的phpstorm快捷键总结(带截屏版) 目 录 PhpStorm的快捷键有10类 1.编辑相关 2.搜索/替换 3.被使用搜索 4.项目运行 5.debug相关 6.导航相关 7.重构相关 8. ...
- (3) go 指针
1.获取地址 取地址 &i 2.指针 var p *int=&i ptr 是一个地址 *ptr 是可看成一个变量,该地址所在的变量,也就是 num 3.常见值类型 引用类型 值类型:栈 ...
- BZOJ2654/COGS1764 [2012国家集训队]tree(陈立杰) [生成树,二分]
BZOJ传送门,COGS传送门 tree Description 给你一个无向带权连通图,每条边是黑色或白色.让你求一棵最小权的恰好有need条白色边的生成树. 题目保证有解. Input 第一行V, ...
- div的border & width
长时间不用css,发现有些基础知识竟有些遗忘,由于项目中的一些css样式,进行了以下相关测试. div的width及height均设置为0后,div的border会怎样显示.经过测试后,发现borde ...
- Flume学习应用:Java写日志数据到MongoDB
概述 Windows平台:Java写日志到Flume,Flume最终把日志写到MongoDB. 系统环境 操作系统:win7 64 JDK:1.6.0_43 资源下载 Maven:3.3.3下载.安装 ...