Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding a page about monkeypatches (technically in funfactory)

  • Loading branch information...
commit 94bd4521024a65dd9118408fcc2313789405e4f6 1 parent f59371d
Peter Bengtsson authored
Showing with 31 additions and 0 deletions.
  1. +1 −0  index.rst
  2. +30 −0 monkeypatches.rst
1  index.rst
View
@@ -79,6 +79,7 @@ Contents
upgrading
bestpractices
troubleshooting
+ monkeypatches
Indices and tables
30 monkeypatches.rst
View
@@ -0,0 +1,30 @@
+.. _monkeypatches:
+
+==============
+Monkey patches
+==============
+
+Unfortunately we have to rely on a set of monkey patches. These are
+`loaded from funfactory
+<https://github.com/mozilla/funfactory/blob/master/funfactory/monkeypatches.py>`_
+actually.
+
+Why this works is because the first installed app is always
+``funfactory`` and the first thing Django does after configuring itself
+(i.e. ``django.conf.settings`` is a module) is to load the
+``models.py`` file from every installed app.
+
+Ideally all monkey patches will one day go away. Either by individual
+apps getting smarter or Django getting smarter.
+
+The reason the monkey patches are in funfactory is because it is
+assumed that all playdoh instances will need the monkey patches and
+therefore it's a convenience to put this into funfactory. Most of the
+monkey patches are unobtrusive meaning they are not applied unless the
+relevant app is in your ``INSTALLED_APPS``.
+
+.. note::
+
+ Because we're relying on a Django specific trick (that models.py
+ are always loaded) the ``monkeypatches.patch()`` function will
+ write to ``logging.debug()``
Please sign in to comment.
Something went wrong with that request. Please try again.