add versioning support to the API

This commit is contained in:
jonaswinkler
2021-02-24 22:27:43 +01:00
parent df87599f1b
commit 3d3300ac32
7 changed files with 53 additions and 2 deletions

View File

@@ -112,7 +112,10 @@ REST_FRAMEWORK = {
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication'
]
],
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.AcceptHeaderVersioning',
'DEFAULT_VERSION': 'v1',
'ALLOWED_VERSIONS': ['1', '2']
}
if DEBUG:
@@ -142,7 +145,7 @@ ASGI_APPLICATION = "paperless.asgi.application"
STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", "/static/")
# what is this used for?
# TODO: what is this used for?
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',