Aninhando URLs com path, include e urls.py dos apps do Django

This commit is contained in:
Luiz Otávio
2023-04-16 14:57:04 -03:00
parent 4d721daa8d
commit e2be22efd8
5 changed files with 25 additions and 7 deletions

View File

@@ -14,13 +14,11 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from blog import views as blog_views
from django.contrib import admin
from django.urls import path
from home import views as home_views
from django.urls import include, path
urlpatterns = [
path('', home_views.home),
path('blog/', blog_views.blog),
path('', include('home.urls')),
path('blog/', include('blog.urls')),
path('admin/', admin.site.urls),
]