S
S
SergiusGei2018-07-06 15:54:33
Django
SergiusGei, 2018-07-06 15:54:33

Is the directory in a Django project containing the __init__.py file a module?

If, for example, __init__.py is located in the blog folder, then in the main urls.py I can include this directory as follows

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


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

Where is the mistake?

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