Coding Patterns in Django
Sometimes it is nice to automatically add the current user into a field, like to easily keep track of the last user who modified a record or automatically set the “author” of a record. In earlier versions of Django this was pretty simple, but with validation added to Django, it requires a bit more work.
A decorator app is an application that adds functionality to another application without the application's awareness. It is different than a Python decorator, rather it follows the idea from Design Patterns: Elements of Reusable Object-Oriented Software.
This pattern allows for refactoring the view code into several files without effecting the import process in other files. In other words from coolapp.views import foo still works.
Updated the example script to use Stefan Foulis' PEP 386-compliant example from https://gist.github.com/1149730
You want to allow configuration of your app without having to modify its code. You may also want to provide reasonable defaults that users can override.