A tiny project to log login attempts. Log them only to standard logging - not the database.
pip install django-auth-logger==2.2.0
This is a modest Django app that contains how thelab likes to log authentication for staff users. It may be useful to others, but could easily just be copied.
First, install the package from PyPI.
pip install django-auth-logger
Then, add auth_logger to your Django project's INSTALLED_APPS setting.
INSTALLED_APPS = [
...
'auth_logger',
...
]
By default both successful and failed log-ins are logged to standard Python logging (at INFO level).
In the future we may decide to add more configuration options.
The scope of this project is small and specific - but we welcome adding configuration settings to change behavior and meet more use cases. All configuration options should have a test to verify it works.
If we do add said configuration it will probably look something like this:
AUTH_LOGGER = {
'LOG_ONLY_STAFF': True
}