ejercicio: entendiendo las urls y las vistas.
This commit is contained in:
		
							
								
								
									
										8
									
								
								tienda_ilusion/don_confiao/urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								tienda_ilusion/don_confiao/urls.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| from django.urls import path | ||||
|  | ||||
| from . import views | ||||
|  | ||||
| urlpatterns = [ | ||||
|     path("comprar", views.buy, name="buy"), | ||||
|     path("", views.index, name="wellcome"), | ||||
| ] | ||||
| @@ -1,3 +1,8 @@ | ||||
| from django.shortcuts import render | ||||
| from django.http import HttpResponse | ||||
|  | ||||
| # Create your views here. | ||||
| def index(request): | ||||
|     return HttpResponse("<h1>Don Confiado</h1></br><a href='./comprar'>Comprar</a>") | ||||
|  | ||||
| def buy(request): | ||||
|     return HttpResponse("Nombre: ....") | ||||
|   | ||||
| @@ -15,8 +15,9 @@ Including another URLconf | ||||
|     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls')) | ||||
| """ | ||||
| from django.contrib import admin | ||||
| from django.urls import path | ||||
| from django.urls import include, path | ||||
|  | ||||
| urlpatterns = [ | ||||
|     path("don_confiao/", include("don_confiao.urls")), | ||||
|     path('admin/', admin.site.urls), | ||||
| ] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user