Simple abstraction layer for django.contrib.auth.signals
Project description
django-auth-signals
===================
Simple abstraction layer for django.contrib.auth.signals <https://docs.djangoproject.com/en/dev/ref/contrib/auth/#module-django.contrib.auth.signals>.
Usage
-----
Add `auth_signals_connector` to `INSTALLED_APPS`:
```
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'auth_signals_connector'
)
```
By defaults, `auth_signals_connector` uses `auth_signals_connector.connector`
logger to log about 'login', 'logout' and 'login failed' actions.
You could change default behaviour in your `settings.py`:
```
AUTH_SIGNALS = {
'use_defaults': True,
'on_logged_in': some_login_func,
'on_logged_out': some_logout_func,
'on_login_failed': some_loginfail_func,
}
```
If `use_defaults` is `True`, default log handlers will be used too.
===================
Simple abstraction layer for django.contrib.auth.signals <https://docs.djangoproject.com/en/dev/ref/contrib/auth/#module-django.contrib.auth.signals>.
Usage
-----
Add `auth_signals_connector` to `INSTALLED_APPS`:
```
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'auth_signals_connector'
)
```
By defaults, `auth_signals_connector` uses `auth_signals_connector.connector`
logger to log about 'login', 'logout' and 'login failed' actions.
You could change default behaviour in your `settings.py`:
```
AUTH_SIGNALS = {
'use_defaults': True,
'on_logged_in': some_login_func,
'on_logged_out': some_logout_func,
'on_login_failed': some_loginfail_func,
}
```
If `use_defaults` is `True`, default log handlers will be used too.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file auth-signals-connector-0.1.0.tar.gz
.
File metadata
- Download URL: auth-signals-connector-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72167bcf42f297fb836764f8ff6d7023fb1bf794c1376b0e5d58cf457efea757 |
|
MD5 | 97266f1e9b5cfa5f772e98a3cb382649 |
|
BLAKE2b-256 | 0c8f3ba6f258a523571ab907afd9071bba76b20b04ad569fa03e807e63b0b8f3 |