Django_rest_api/backend/drf_course/urls.py
devfzn fa10284b72
creación de app ecommerce + token authentication
Editados settings.py y urls.py del sitio para app y uso de token.

Implementación de token para app ecommerce en ruta /api-token-auth,
uso de clase Token del rest_framework y signals de Django, para
creación de token post-save.
2023-03-30 13:02:53 -03:00

16 lines
420 B
Python

from django.contrib import admin
from django.urls import path
from core import views as core_views
from rest_framework import routers
from rest_framework.authtoken.views import obtain_auth_token
router = routers.DefaultRouter()
urlpatterns = router.urls
urlpatterns += [
path('admin/', admin.site.urls),
path('contact/', core_views.ContactAPIView.as_view()),
path('api-token-auth/', obtain_auth_token),
]