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

@@ -0,0 +1,8 @@
from blog import views
from django.urls import path
# blog/
urlpatterns = [
path('', views.blog),
path('exemplo/', views.exemplo),
]

View File

@@ -5,4 +5,9 @@ from django.http import HttpResponse
def blog(request):
print('blog')
return HttpResponse('blog do app')
return HttpResponse('blog do app 1')
def exemplo(request):
print('exemplo')
return HttpResponse('exemplo do app 1')