https://raw.githubusercontent.com/nicchub/django-doberman/master/images/DjangoDoberman.png
``django-doberman`` Django app that locks out users after too many failed login attempts.
.. image:: https://img.shields.io/pypi/v/django-doberman.svg
:target: https://pypi.python.org/pypi/django-doberman
.. image:: https://travis-ci.org/django-py/django-doberman.svg?branch=master
:target: http://travis-ci.org/django-py/django-doberman
.. image:: https://img.shields.io/pypi/dm/django-doberman.svg
:target: https://pypi.python.org/pypi/django-doberman
Requirements
------------
- Python => 2.7
- Django => 1.7
Installation
------------
1. You can install the latest stable package running this command:
$ pip install django-doberman
Also you can install the development version running this command::
$ pip install -e git+http://github.com/nicchub/django-doberman.git#egg=django_doberman-dev
2. Add ``doberman`` to ``INSTALLED_APPS`` in your Django settings file
INSTALLED_APPS = (
...
'django.contrib.messages',
'django.contrib.admin',
...
'doberman',
)
3. ./manage.py migrate doberman || or sync your database
Development
------------
You can contribute to this project forking it from github and sending pull requests.
Running tests
-------------
Tests can be run, after you clone the repository and having django installed, like::
PYTHONPATH=$PYTHONPATH:$PWD django-admin.py test doberman --settings=doberman.tests.test_settings
Configuration
--------
DOBERMAN_MAX_FAILED_ATTEMPTS
Default: ``10``.
Number of max failed login attempt.
DOBERMAN_LOCKOUT_TIME
Default: ``600`` (10 minutes).
Number of seconds after the failed login attempts are forgotten in seconds.
DOBERMAN_REAL_IP_ONLY
'Default': True
Set to False if you are working on localhost or a development environment.
DOBERMAN_LOGIN_FORGOTTEN_SECONDS
Default: ``300``
Timeout forgotten login attempts of user.
DOBERMAN_USERNAME_FORM_FIELD
Default: 'username'
Field username form field, change when you are use a diferent "username", for example: 'email'.
DOBERMAN_LOCKOUT_TEMPLATE
Path to alternative lockout template.
DOBERMAN_MODEL
Default: 'doberman.FailedAccessAttempt'
Allow to use a custom Model for tracking failed Access Attempts.
DOBERMAN_IP_META_PRECEDENCE_ORDER
Default: (
'HTTP_X_FORWARDED_FOR', # X-Forwarded-For: client, proxy1, proxy2
'HTTP_CLIENT_IP',
'HTTP_X_REAL_IP',
'HTTP_X_FORWARDED',
'HTTP_X_CLUSTER_CLIENT_IP',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'HTTP_VIA',
'REMOTE_ADDR',
)
This used for discovery the real IP, you can change the precedence order.
Usage
-----
Add ``doberman.decorators.watch_login`` decorator to your login view. Example::
class LoginView(FormView):
template_name = 'example/login.html'
form_class = AuthenticationForm
@method_decorator(watch_login)
def dispatch(self, request, *args, **kwargs):
if request.user.is_authenticated():
return redirect(settings.LOGIN_REDIRECT_URL)
return super(LoginView, self).dispatch(request, *args, **kwargs)
def form_valid(self, form):
user = form.get_user()
login(self.request, user)
return super(LoginView, self).form_valid(form)
def get_success_url(self):
return reverse('logged_in')
Authors
-------
Library is by `Hanlle Nicolas Mendoza`.
.. Website: http://nicolasmendoza.org/
.. image:: https://d2weczhvl823v0.cloudfront.net/nicchub/django-doberman/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
Metadata
Release files for django-doberman 0.5.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-doberman-0.5.9.tar.gz | 14.1 kB | Without provenance | Details for django-doberman-0.5.9.tar.gz |
Release files / django-doberman-0.5.9.tar.gz
| Download URL | django-doberman-0.5.9.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41d05c56d1821e49fd163fef33808fbe20d721f17bfd37f3184ea315958edb0c
|
|
BLAKE2b-256 checksum How to use checksums |
17b606f29bf1edfb8b97f58c50f2b7264cfd9729e850d9a18a2075ae092c4511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-doberman 0.5.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.