#29 feat(Auth): add login.
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form.as_p }}
|
||||||
|
<button type="submit">Iniciar sesión</button>
|
||||||
|
</form>
|
||||||
@@ -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"),
|
||||||
|
|||||||
@@ -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',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user