diff --git a/doc/upgrade.rst b/doc/upgrade.rst index b8e272ecb..48c5b3170 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -87,12 +87,14 @@ Specific instructions 1.7.2 ===== -CKeditor is now embedded by default (thanks to the ``django-ckeditor`` -package) and some configuration changes are required to make it work. +API documentation has evolved (because of the upgrade to Django Rest +Framework 3.6) and CKeditor is now embedded by default (thanks to the +``django-ckeditor`` package). Some configuration changes are +required. Edit your :file:`settings.py` file and apply the following modifications: -* Add ``ckeditor`` and ``ckeditor_uploader`` to ``INSTALLED_APPS`` +* Update the ``INSTALLED_APPS`` variable as follows: .. sourcecode:: python @@ -106,10 +108,23 @@ Edit your :file:`settings.py` file and apply the following modifications: 'reversion', 'ckeditor', 'ckeditor_uploader', + 'rest_framework', 'rest_framework.authtoken', - 'rest_framework_swagger', ) +* Update the ``REST_FRAMEWORK`` variable as follows: + +.. sourcecode:: python + + REST_FRAMEWORK = { + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.TokenAuthentication', + 'rest_framework.authentication.SessionAuthentication', + ), + } + +* Remove the ``SWAGGER_SETTINGS`` variable + * Add the following content .. sourcecode:: python diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index 672df2db0..4f3b09009 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -169,24 +169,6 @@ REST_FRAMEWORK = { 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.SessionAuthentication', ), - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.IsAuthenticated', - ) -} - -SWAGGER_SETTINGS = { - "is_authenticated": False, - "api_version": "1.0", - "exclude_namespaces": [], - "info": { - "contact": "contact@modoboa.com", - "description": ( - "Modoboa API, requires a valid token. To obtain a token, login " - "as super administrator, go to 'User settings > API' and enable " - "API access. Click on 'Update' and wait for page refresh." - ), - "title": "Modoboa API documentation", - } } # Modoboa settings