| 1 |
Configuration |
| 2 |
============= |
| 3 |
|
| 4 |
Available settings: |
| 5 |
|
| 6 |
``HEADLESS_ADAPTER`` (default: ``"allauth.headless.adapter.DefaultHeadlessAdapter"``) |
| 7 |
Specifies the adapter class to use, allowing you to alter certain |
| 8 |
default behavior. |
| 9 |
|
| 10 |
``HEADLESS_CLIENTS`` (default: ``("app", "browser")``) |
| 11 |
Specifies the supported types of clients for the API. Setting this to |
| 12 |
e.g. ``("app",)`` will remove all ``"browser"`` related endpoints. |
| 13 |
|
| 14 |
``HEADLESS_FRONTEND_URLS`` (default: ``{}``) |
| 15 |
Email confirmation and password reset mails contain links that by default point to the |
| 16 |
views from the ``allauth.account`` app. In case you need to point these to your own frontend |
| 17 |
application, you can do so by configuring this setting, as follows:: |
| 18 |
|
| 19 |
HEADLESS_FRONTEND_URLS = { |
| 20 |
"account_confirm_email": "https://app.project.org/account/verify-email/{key}", |
| 21 |
# Key placeholders are automatically populated. You are free to adjust this |
| 22 |
# to your own needs, e.g. |
| 23 |
# |
| 24 |
# "https://app.project.org/account/email/verify-email?token={key}", |
| 25 |
"account_reset_password": "https://app.project.org/account/password/reset", |
| 26 |
"account_reset_password_from_key": "https://app.project.org/account/password/reset/key/{key}", |
| 27 |
"account_signup": "https://app.project.org/account/signup", |
| 28 |
# Fallback in case the state containing the `next` URL is lost and the handshake |
| 29 |
# with the third-party provider fails. |
| 30 |
"socialaccount_login_error": "https://app.project.org/account/provider/callback", |
| 31 |
} |
| 32 |
|
| 33 |
``HEADLESS_ONLY`` (default: ``False``) |
| 34 |
You can use headless-only mode in case your application fully takes care of |
| 35 |
the frontend, and you do not want for e.g. the login and signup views to be |
| 36 |
accessible. In this case, including ``allauth.urls`` skips those views, yet, |
| 37 |
still includes e.g. the provider callback views. |
| 38 |
|
| 39 |
``HEADLESS_SERVE_SPECIFICATION`` (default: ``False``) |
| 40 |
Whether or not to serve the OpenAPI specification files. When enabled, the |
| 41 |
endpoints ``/_allauth/openapi.yaml``, ``/_allauth/openapi.json`` and |
| 42 |
``/_allauth/openapi.html`` become available. This functionality requires |
| 43 |
the extra ``django-allauth[headless-spec]`` to be installed. |
| 44 |
|
| 45 |
``HEADLESS_SPECIFICATION_TEMPLATE_NAME`` (default: ``"headless/spec/redoc_cdn.html"``) |
| 46 |
The template used to serve the OpenAPI specification in HTML format. Out of the box, |
| 47 |
Redoc (``"headless/spec/redoc_cdn.html"``) and Swagger ( |
| 48 |
(``"headless/spec/swagger_cdn.html"``) are available. |
| 49 |
|
| 50 |
``HEADLESS_TOKEN_STRATEGY`` (default: ``"allauth.headless.tokens.strategies.sessions.SessionTokenStrategy"``) |
| 51 |
If you need to change the way tokens are created and handled, you can plug in your own |
| 52 |
:doc:`./tokens`. |