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: ....")
|
||||
|
||||
Reference in New Issue
Block a user