#29 feat(Auth): add login.

This commit is contained in:
2025-12-13 12:24:35 -05:00
parent 6261d64206
commit b730d24855
3 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Iniciar sesión</button>
</form>

View File

@@ -1,4 +1,5 @@
from django.urls import path, include from django.urls import path, include
from django.contrib.auth.views import LoginView
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
from . import views from . import views
@@ -15,6 +16,7 @@ router.register(r'reconciliate_jar', api_views.ReconciliateJarModelView,
urlpatterns = [ urlpatterns = [
path("", views.index, name="wellcome"), path("", views.index, name="wellcome"),
path("accounts/", include("django.contrib.auth.urls")),
path("comprar", views.buy, name="buy"), path("comprar", views.buy, name="buy"),
path("compras", views.purchases, name="purchases"), path("compras", views.purchases, name="purchases"),
path("productos", views.products, name="products"), path("productos", views.products, name="products"),

View File

@@ -134,3 +134,12 @@ STATIC_URL = 'static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
FIXTURE_DIRS = ['don_confiao/tests/Fixtures'] FIXTURE_DIRS = ['don_confiao/tests/Fixtures']
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
}