python django1.10解决view must be a callable list/tuple in case of include()
来源:互联网 发布:如何看到淘宝追加评论 编辑:程序博客网 时间:2024/06/14 17:49
同步数据
python manage.py syncdb
注意:Django 1.7.1及以上的版本需要用以下命令
python manage.py makemigrations
python manage.py migrate
django 1.10
参考 https://docs.djangoproject.com/en/1.10/topics/http/urls/#example
You need to import your views and reference the callable as described,Referencing the view by string using patterns() is deprecated:
目录结构
mysite下的url.py, from . import views 引入当前目录的 views,include 导入外部的urls
from django.conf.urls import include, url
from django.contrib import admin
from . import views
admin.autodiscover()
urlpatterns = (
# Examples:
url(r'^$', views.first_page),
url(r'^admin/', admin.site.urls),
url(r'^west', include('west.urls')),
)
west下的urls.py 导入本目录下的views,
from django.contrib import admin
from . import views
admin.autodiscover()
urlpatterns = (
# Examples:
url(r'^$', views.first_page),
url(r'^admin/', admin.site.urls),
)
django 1.8
https://docs.djangoproject.com/en/stable/releases/1.8/#django-conf-urls-patterns
from django.conf.urls import patterns, include, url
from django.contrib import admin
import settings
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^event/$', include('apps.index.urls')),
url(r'^event/gearman/$', include('apps.gearman.urls')),
url(r'^event/message/$', include('apps.message.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
url(r^test/,'test.views.tt'),
)
- python django1.10解决view must be a callable list/tuple in case of include()
- 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().
- 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()
- TypeError: view must be a callable or a list/tuple in the case of include()
- django 单元测试报错: view must be a callable or a list/tuple in the case of include().
- django 运行报错view must be a callable or a list/tuple in the case of include()
- django 运行报错view must be a callable or a list/tuple in the case of include()
- python 学习---isinstance() arg 2 must be a type or tuple of types
- 解决android报错IllegalArgumentException: parameter must be a descendant of this view
- Parameter must be a descendant of this view 错误
- Main application must be in the list of application paths
- Python异常:Django1.11--context must be a dict rather than RequestContext.
- Input strings must be a multiple of 16 in length
- 解决A master URL must be set in your configuration
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- 离散化操作
- android UEventObserver的用法
- synchronized 中 intern 用法
- poj 3040
- js验证表单输入框
- python django1.10解决view must be a callable list/tuple in case of include()
- springMVC两种方式实现多文件上传及效率比较
- NOIP 2013 CODE[VS] 3287 货车运输 倍增LCA + 最大生成树
- Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules
- 【知识分享】利用DOS命令将txt文件隐藏在图片中
- android studio 移植 ffmpeg
- 在什么情况下使用线程池
- mysql5.7.11修改root默认密码
- Jquery load方法的用法