Django的urls.py加载静态资源图片,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'^images/(?P<path>.*)$', s…
django增加用户认证模块时,总是提醒模块的url.py中 url(r'^login/$', 'django.contrib.auth.views.login', name='login'),出错: TypeError: view must be a callable or a list/tuple in the case of include(). 解决办法:改为下面的写法 from django.contrib.auth.views import login ... url(r'^logi…
.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…
django版本:1.11.15 django应用,修改urls.py后,访问报错:TypeError at /view must be a callable or a list/tuple in the case of include(). 修改后的urls.py文件:from django.conf.urls import urlfrom django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls),…
Django 1.10 no longer allows you to specify views as a string (e.g. 'myapp.views.home') in your URL patterns. The solution is to update your urls.py to include the view callable. This means that you have to import the view in your urls.py. If your UR…
报错: TypeError: isinstance() arg must be a type or tuple of types from django.db import modelsfrom django.contrib.auth.models import AbstractUserfrom blog.models import Blog class UserInfo(AbstractUser): , unique=True) # USERNAME_FIELD = 'identifier'…