L
L
lemonchik372021-07-30 11:41:07
Django
lemonchik37, 2021-07-30 11:41:07

Why is this kind of error thrown on the python manage.py runserver command?

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

also here is the code on
urls.py

from django import urls
from django.contrib import admin
from django.urls import path, include

app_name = 'learning_logs'
urlpatterns = [
    path('admin/', admin.site.urls),
    path('',('learning_logs.urls')),]

from django.urls import path
from learning_logs.views import views

urlpatterns = [
    path('',views.index,name = 'index'),
    path('topics/',views.topics, name='topics'),
    path('topics/<int:topic_id>/',views.topic,name = 'topic'),
]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question