Django Intruder is a simple and unobtrusive application to intercept requests. It is useful to enable and disable features, for continuous deployment purpouses.
pip install django-intruder
# Download zip file # Extract it # Execute in the extracted directory: python setup.py install
pip install django-intruder --upgrade
- A tool for Feature Flip (a usual practice for Continuous Deployment) must not be intrusive.
- If you have to add more source code in your project, it increase the chances to include more errors in the application.
Comparison with another fixture tools
- You do not have to add extra source code in your project for each view or url, like other tools.
- Completely dynamic: you can enable or disable a feature in the admin interface.
- List of other similar tools: http://djangopackages.com/grids/g/feature-flip/
- Highly customizable: you can pass a regular expression to filter a set of urls.
- Simple: you can select a view to disable ou re-enable.
- You can define to which view you want to redirect the user.
- Rules are cached to improve the performance.
Example of Usage
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'intruder', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', # required 'intruder.middleware.IntruderMiddleware', ) # Optional, you can define this to create a list of default views you want to redirect: INTRUDER_DEFAULT_REDIRECT_VIEWS = (('', '-----'), ('intruder.views.feature_under_maintenance', 'Feature under maintenance'), ('intruder.views.feature_is_no_longer_available', 'Feature is no longer available'))
- Access: http://YOUR_DOMAIN/admin/intruder/
Information about the logic of the library
- If a redirect view no longer exist, the rule will be ignored.
- If any error occur in the middleware, it will be ignored and the original view will be processed normally.
Links of Comments
- 2011/10/27 (yyyy/mm/dd)
- Removing Permission from admin interface
Handling middleware errors
Better layout for default redirect pages
- INTRUDER_DEFAULT_REDIRECT_VIEWS property in settings
- New admin interface to facilitate to select redirect view
- Command in admin interface to clear the Intruder cache
- 2011/10/12 (yyyy/mm/dd)
- Ready to use in big projects
- Changes in the database schema (no migrations, it is just the beginning of this project)
- Now it do not block the admin interface
- Clear cache on object delete
- Cache problem when we have more than one view_name blank
- unique=True and null=True was inconsistent for some databases
- 2011/10/08 (yyyy/mm/dd)
- Initial Version
- Experimental Version