Don't recommend putting important code in manage.py. #9

Merged
merged 1 commit into from Feb 10, 2012

Projects

None yet

2 participants

@carljm
Mozilla member

Currently the django-session-csrf README recommends putting the monkeypatch code in manage.py. Placing code that your project relies on to function in manage.py is an anti-pattern, as there is no reason to believe that manage.py will ever be executed in a production deployment of a Django app; in many common deployment setups it is not.

Fortunately there is a simple and equally functional alternative; if the monkeypatch is done in the root urls.py before the url patterns are declared, it will still take effect before views are imported. This pull request recommends that instead.

@jbalogh jbalogh merged commit 94e2858 into mozilla:master Feb 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment