vistas iniciales en las tablas

This commit is contained in:
2023-02-16 13:11:32 +01:00
parent b07813a859
commit 9510c9bed2
10 changed files with 76 additions and 6 deletions

View File

@@ -6,4 +6,10 @@ Lista de la compra
### Proceso
- ([Build And Deploy A REST API With Django REST Framework. Full Project Tutorial. - YouTube 00:26:15](https://youtu.be/Sjv-HTLmnB4))
##### Commit 1
- [Build And Deploy A REST API With Django REST Framework. Full Project Tutorial. - YouTube 00:26:15](https://youtu.be/Sjv-HTLmnB4)
#### Commit 2
- 00:29:00

6
comparte/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.HelloComparteView.as_view(), name='hello_comparte'),
]

View File

@@ -1,3 +1,12 @@
from django.shortcuts import render
# from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.response import Response
# Create your views here.
class HelloComparteView(generics.GenericAPIView):
def get(self, request):
return Response(data={"message": "Hello Comparte"},
status=status.HTTP_200_OK)

6
compra/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.HelloCompraView.as_view(), name='hello_compra'),
]

View File

@@ -1,3 +1,12 @@
from django.shortcuts import render
# from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.response import Response
# Create your views here.
class HelloCompraView(generics.GenericAPIView):
def get(self, request):
return Response(data={"message": "Hello Compra"},
status=status.HTTP_200_OK)

6
item/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.HelloItemView.as_view(), name='hello_item'),
]

View File

@@ -1,3 +1,12 @@
from django.shortcuts import render
# from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.response import Response
# Create your views here.
class HelloItemView(generics.GenericAPIView):
def get(self, request):
return Response(data={"message": "Hello Item"},
status=status.HTTP_200_OK)

6
lista/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.HelloListaView.as_view(), name='hello_lista'),
]

View File

@@ -1,3 +1,12 @@
from django.shortcuts import render
# from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.response import Response
# Create your views here.
class HelloListaView(generics.GenericAPIView):
def get(self, request):
return Response(data={"message": "Hello Lista"},
status=status.HTTP_200_OK)

View File

@@ -3,5 +3,9 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('auth/', include('authentication.urls'))
path('auth/', include('authentication.urls')),
path('comparte/', include('comparte.urls')),
path('compra/', include('compra.urls')),
path('item/', include('item.urls')),
path('lista/', include('lista.urls')),
]