Skip to content

Commit

Permalink
docs: Improve installation instructions
Browse files Browse the repository at this point in the history
- Move allauth integrations details to installation.rst, instead of
  spearding out those instructions over two files.
- Mention configuring INVITATIONS_ADAPTER, as mentioned in
  docs/configuration.rst
- Improve formatting and add links.
- Mention that newer versions of Django and Python are supported.
  • Loading branch information
Flimm committed Jun 18, 2024
1 parent 5945342 commit da2e3b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
28 changes: 20 additions & 8 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ Installation
Requirements
------------

Python 3.7 to 3.10 supported.
Python 3.8 to 3.12 supported.

Django 3.2 to 4.0 supported.
Django 3.2 to 5.0 supported.

Installation
------------

1. Install with **pip**:
1. Install with `pip <https://pip.pypa.io/>`_:

.. code-block:: sh
python -m pip install django-invitations
2. Add "invitations" to INSTALLED_APPS
2. Add ``"invitations"`` to ``INSTALLED_APPS``:

.. code-block:: python
Expand All @@ -27,21 +27,33 @@ Installation
...
]
.. note:: **Allauth support**
.. note:: **django-allauth support**

For allauth support ``invitations`` must come after ``allauth`` in the INSTALLED_APPS
For django-allauth support, ``"invitations"`` must come after ``"allauth"`` in the ``INSTALLED_APPS`` list.

3. Add invitations urls to your urlpatterns:
3. If using `django-allauth <https://docs.allauth.org/>`_, then add this configuration to your ``settings.py`` file:

.. code-block:: python
# django-allauth configuration:
ACCOUNT_ADAPTER = "invitations.models.InvitationsAdapter"
# django-invitations configuration:
INVITATIONS_ADAPTER = ACCOUNT_ADAPTER
4. Add invitations URLs to your ``urlpatterns``:

.. code-block:: python
from django.urls import include, path
urlpatterns = [
...
path("invitations/", include('invitations.urls', namespace='invitations')),
...
]
4. Run migrations
5. Run migrations:

.. code-block:: sh
Expand Down
11 changes: 0 additions & 11 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ If ``allauth`` is being used under its default settings, then two ``EmailAddress

Further details can be found in the following sections.

Allauth Integration
-------------------

As above but note that invitations must come after allauth in the INSTALLED_APPS

Set the allauth ``ACCOUNT_ADAPTER`` setting

.. code-block:: python
ACCOUNT_ADAPTER = 'invitations.models.InvitationsAdapter'
Sending Invites
---------------

Expand Down

0 comments on commit da2e3b2

Please sign in to comment.