F
F
fantom_ask2020-07-22 08:29:18
Django
fantom_ask, 2020-07-22 08:29:18

Why can't django find the module?

I wrote in the urls.py file

from django.urls import path, include

urlpatterns = [
    path('articles/', include('articles.urls')),
    path('admin/', admin.site.urls),

and created a urls.py file with the code in the articles folder

from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name = "index")
]

But when starting the server, it says that the articles module was not found,
does anyone know how to find out what the problem is or where exactly django is looking for the module
when I tried to display it, nothing was displayed print(include('articles.urls'))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cython, 2020-07-22
@cython

In settings.py, you need to connect the articles application by adding the name of your application (articles) to the INSTALLED_APPS list

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question