Install from PyPI:
pip install django-firefence
Add the middleware and configure some rules:
MIDDLEWARE = [
...
'firefence.middleware.FirefenceMiddleware',
...
]
FIREFENCE = {
'RULES': [
{
'action': 'ALLOW',
'host': '192.168.1.1',
'port': '80, 443',
}
]
}
This will check all incoming requests to your app against these rules. Use of the middleware is optional and you can check only certain views by using provided decorators. Please consult the documentation for more information.
django-firefence is a project developed to provide firewall style request filtering to a Django project at the application level or at the view level.
The library is compatible with currently supported versions of Django.
Feel free to file an issue on the Github project issue page.
Full documentation is available at: http://django-firefence.readthedocs.io/