Added jwt, swagger...

This commit is contained in:
maciejrusek
2026-03-11 23:20:03 +01:00
parent f84c708f0a
commit ca605ac59d
14 changed files with 83 additions and 7 deletions

View File

@@ -16,6 +16,7 @@ ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
"apps.authentication.apps.AuthenticationConfig",
"apps.user.apps.UserConfig",
"apps.shelves.apps.ShelvesConfig",
"django.contrib.admin",
@@ -26,6 +27,8 @@ INSTALLED_APPS = [
"django.contrib.staticfiles",
"rest_framework",
"django_filters",
"rest_framework_simplejwt",
"drf_spectacular",
]
MIDDLEWARE = [
@@ -89,6 +92,26 @@ AUTH_PASSWORD_VALIDATORS = [
AUTH_USER_MODEL = "user.User"
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
],
'DEFAULT_PARSER_CLASSES': [
'rest_framework.parsers.JSONParser',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
],
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
}
SPECTACULAR_SETTINGS = {
'TITLE': 'Library API',
'DESCRIPTION': 'Library project',
'VERSION': '1.0.0',
'SERVE_INCLUDE_SCHEMA': False,
}
# Internationalization
# https://docs.djangoproject.com/en/6.0/topics/i18n/