ejercicio: entendiendo las urls y las vistas.

This commit is contained in:
Mono Mono 2024-06-22 15:24:05 -05:00
parent 4bc47ebd79
commit 70a70f6620
3 changed files with 16 additions and 2 deletions

View 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"),
]

View File

@ -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: ....")

View File

@ -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),
]