.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().的更多相关文章

  1. django中出现 错误 Errno 10053

    django中出现 错误 Errno 10053 pycharm里出现下面错误File "C:\Python27\lib\socket.py", line 307, in flus ...

  2. Django学习——collectstatic错误

    Error fetching command 'collectstatic': You're using the staticfiles app without having set the STAT ...

  3. Django Forms的错误提示

    1.error_messages={} 首先,在构建form表单时,可以用"error_messages={}"自定义错误信息,例如: # form.py 1 from djang ...

  4. Django笔记-常见错误整理

    1.csrf错误 解决方法:在settings.py里注释掉相关内容即可 MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.Sess ...

  5. Django中csrf错误

    CSRF(Cross-site request forgery)跨站请求伪造,也被称为“one click attack”或者session riding,通常缩写为CSRF或者XSRF,是一种对网站 ...

  6. django http 403 错误

    在使用android的xUtils框架提交post请求到django服务器上面,出现错误,返回Forbiddeen.解决方法记录于此. 参考链接 http://blog.csdn.net/liangp ...

  7. django插入数据库错误:mysql的1267错误

    错误信息: django.db.utils.OperationalError: (1267, "Illegal mix of collations (latin1_swedish_ci,IM ...

  8. django之异常错误2(Error was: No module named sqlite3.base)

    具体错误代码为: C:\djangoweb\helloworld>manage.py syncdbTraceback (most recent call last):  File "C ...

  9. Django用户名密码错误提示

    from django.shortcuts import render # Create your views here. from django.shortcuts import render fr ...

随机推荐

  1. How To Install Nginx on Ubuntu 16.04 zz

    Introduction Nginx is one of the most popular web servers in the world and is responsible for hostin ...

  2. hdu 3277(二分+最大流+拆点+离线处理+模板问题...)

    Marriage Match III Time Limit: 10000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  3. WordPress Shortcode(简码)介绍及使用详解

    WordPress 从 2.5 版本开始增加了一个类似 BBCode 标签的 Shortcode API,可以使用它在日志的内容中来给日志内容添加各种功能.Shortcode 这个接口非常容易使用,并 ...

  4. 微信小程序 - "锚点"功能的实现

    “锚点”功能在实际应用设计的好,可以提高用户体验.今天碰到一个类似下面功能: 由于页面数据比较多,除了做些上拉加载,下拉刷新等优化.还可以进行进行分类,如上图.功能要求:点击导航的菜单,相应页面的分类 ...

  5. 微信小程序 - 分包加载

    小程序开发大家都知道,对主包的大小进行了限制,从最初的1M变成了现再的2M,一般情况下是够用了:但是偶尔可能会出现超出2M的可能,我们可以对小程序进行分包加载. 1.小程序分包加载 a. 某些情况下, ...

  6. 按书上的例子,写了个长的go代码

    用于实现快速排序和冒泡排序的东东. 包括了蛮多东西的实现,输入输出,字符串处理等.... bubblesort.go package bubblesort func BubbleSort(values ...

  7. 让你完全理解Base-64是怎么回事

    HTTP将BASE64-编码用于基本认证和摘要认证,在几种HTTP扩展中也使用了该编码. Base-64编码保证了二进制数据的安全 Base-64编码可以将任意一组字节转换为较长的常见文本字符序列,从 ...

  8. Web页面中两个listbox的option的转移

    Html: <div><span>所选时间:</span><select id="xuanyongTimelb" style=" ...

  9. 链式前向星实现的堆优化dij求最短路模板

    #include<cstdio> #include<string> #include<cstdlib> #include<cmath> #include ...

  10. python中浅拷贝和深度拷贝的区别

    在很多面试题中都会问到浅拷贝跟深度拷贝的区别,前几天一个朋友也问到了我浅拷贝跟深度拷贝到底有什么区别,这里就简单举栗子讲一下两者的区别. 浅拷贝(copy()):拷贝父对象,不会拷贝对象的内部的子对象 ...