jazzband / django-invitations

Generic invitations app for Django
GNU General Public License v3.0
559 stars 166 forks source link

Docs: State that the configuration is done by setting a given config var in `settings.py` #240

Open banagale opened 7 months ago

banagale commented 7 months ago

I see it in app_settings that the project's settings file is looked at to derive the various properties.

Might not hurt to put that in prose at the top of configuration.

Maybe an example:

Example settings.py config:

...
# django-invitations configuration
INVITATION_EXPIRY = 5
ALLOW_JSON_INVITES = True
...
valberg commented 7 months ago

The configuration uses a namespace for the variables defined by the prefix attribute on app_settings.AppSettings, which we set to INVITATIONS_. So all configuration options in invitations.app_settings can be overridden with INVITATIONS_{configuration name} in settings.py.

If you have a suggestion on how to make this more clear in the documentation feel free to create a PR :smile:

Flimm commented 2 months ago

I also was thrown by this issue in the documentation. I fixed it with this commit: a05ad23b5a4cf4ad247b882df334fee6ebd1d44c

I now realise that my fix might have been a bit premature, as you can create settings either in AppSettings without the prefix, or in settings.py with the prefix. I feel that most people are using configuration in settings.py, since the installation instructions don't mention how to install a custom app. I apologise if it would have been better to create a pull request for review.