token authentication
This commit is contained in:
@@ -31,9 +31,20 @@ INSTALLED_APPS = [
|
||||
'compra.apps.CompraConfig',
|
||||
# Terceras partes
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'djoser'
|
||||
]
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES':
|
||||
('rest_framework.authentication.TokenAuthentication', ),
|
||||
'DEFAULT_PERMISSION_CLASSES': [
|
||||
'rest_framework.permissions.IsAuthenticated',
|
||||
]
|
||||
}
|
||||
# configure Djoser
|
||||
DJOSER = {"USER_ID_FIELD": "email"}
|
||||
|
||||
AUTH_USER_MODEL = 'authentication.User'
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
@@ -3,10 +3,11 @@ from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('auth/', include('authentication.urls')),
|
||||
path('users/', include('authentication.urls')),
|
||||
path('comparte/', include('comparte.urls')),
|
||||
path('compra/', include('compra.urls')),
|
||||
path('item/', include('item.urls')),
|
||||
path('lista/', include('lista.urls')),
|
||||
path('token/', include('djoser.urls')),
|
||||
path('auth/', include('djoser.urls')),
|
||||
path('auth/', include('djoser.urls.authtoken'))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user