TypeError: view must be a callable or a list/tuple in the case of include()

后端 未结 7 2276
北海茫月
北海茫月 2020-12-06 10:36

I am new to django and python. During url mapping to views i am getting following error: TypeError: view must be a callable or a list/tuple in the case of include().

<
相关标签:
7条回答
  • 2020-12-06 11:38

    you will need to import post_home:

    from django.contrib import admin
    from django.urls import path,include
    from django.conf.urls import url
    from posts.views import post_home
    
    urlpatterns = [
        path('admin/', admin.site.urls),
        path('posts/',post_home),
    ]
    
    0 讨论(0)
提交回复
热议问题