diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index f7e619919..3fa62cc66 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -188,14 +188,17 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media') REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework_simplejwt.authentication.JWTAuthentication', 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.SessionAuthentication', ), 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', + 'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning', + } SPECTACULAR_SETTINGS = { - 'SCHEMA_PATH_PREFIX': r'/api/v1', + 'SCHEMA_PATH_PREFIX': r'/api/v[0-9]', 'TITLE': 'Modoboa API', 'VERSION': '1.0.0', 'SERVE_PERMISSIONS': ['rest_framework.permissions.IsAuthenticated'], diff --git a/requirements.txt b/requirements.txt index 2a0846e20..6bf0481e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,12 +6,15 @@ django-reversion==3.0.8 django-xforwardedfor-middleware==2.0 django-webpack-loader django-otp==1.0.2 +django-filter dj-database-url djangorestframework>=3.11,<3.13 drf-spectacular uritemplate +djangorestframework-simplejwt +drf-flex-fields passlib~=1.7.4 bcrypt # Requires libffi-dev and python-dev