Aninhando URLs com path, include e urls.py dos apps do Django
This commit is contained in:
8
aula207_ola_django/blog/urls.py
Normal file
8
aula207_ola_django/blog/urls.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from blog import views
|
||||
from django.urls import path
|
||||
|
||||
# blog/
|
||||
urlpatterns = [
|
||||
path('', views.blog),
|
||||
path('exemplo/', views.exemplo),
|
||||
]
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user