1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Improve REST API with filters

This commit is contained in:
Yohann D'ANELLO
2020-03-11 11:15:03 +01:00
parent bc97eb1eb4
commit 417cd5da04
15 changed files with 78 additions and 36 deletions

View File

@ -137,12 +137,14 @@ REST_FRAMEWORK = {
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
# TODO Maybe replace it with our custom permissions system
'rest_framework.permissions.DjangoModelPermissions'
'rest_framework.permissions.DjangoModelPermissions',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
]
],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 20,
}
# Internationalization

View File

@ -20,8 +20,7 @@ urlpatterns = [
path('accounts/', include('django.contrib.auth.urls')),
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),
path('logs/', include('logs.urls')),
path('api/', include('api.urls')),
path('api/', include('api.urls')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)