Django升级到1.10,MEDIA_ROOT发生TypeError错误
2024-08-24 04:50:19
Getting error: “TypeError: view must be a callable or a list/tuple in the case of include().” when running Django Server
解决方案:http://stackoverflow.com/questions/40619208/getting-error-typeerror-view-must-be-a-callable-or-a-list-tuple-in-the-case-o
from django.conf import settings
from django.conf.urls.static import static urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
或者
from django.views.static import serve urlpatterns = [
...
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
]
最新文章
- 配置163Yum源自动判断你的系统是Centos版本(适用于5.x或6.x)
- HDU 5923 Prediction
- HBase 专题技术收录
- 左右Map
- sdut 上机练习8面向对象编程(对象的数组)
- Guacamole 介绍
- bzoj2301: [HAOI2011]Problem b懵逼乌斯反演
- 概述java语言
- CentOS7 下安装telnet服务
- VS中的快捷键快速格式化代码,使好看,整齐
- asp.net -mvc框架复习(5)-ASP.NET MVC中的视图简单使用
- 让你的代码减少三倍!使用kotlin开发Android(五) 监听器
- python第二天3.1
- ASP.NET Easyui datagrid增删改+sqlhelper
- 利用python操作excel
- 使用starUML一步一步画顺序图
- Linux 命令之split(将一个大文件根据行数平均分成若干个小文件)
- python中执行shell命令行read结果
- UVa 11054 Gergovia的酒交易
- 各种 Java Thread State【转载】
热门文章
- Maven中setting.xml配置Demo
- C#秘密武器之特性
- 使用 ssh 从 Gerrit 获取 patch 信息
- iOS 判断NSString是否包含某个字符串
- 算法笔记_069:Floyd算法简单介绍(Java)
- vue 不能检测数组长度 值变化原因解析
- 关于苹果开发证书失效的解决方式(2016年2月14日Failed to locate or generate matching signing assets)
- ionic emulate android log
- CodeForces 390E Inna and Large Sweet Matrix(树状数组改段求段)
- JavaScript-常用正则函数(适合忘记时看)