mozilla/playdoh — Issue #90: Getting rid of unfortunately named function setup_environ in funfactory
Author: peterbe
Created: 2011-11-14 19:37:52+00:00
State: open

When we complete https://github.com/mozilla/playdoh/issues/82 we're going to stop using ``django.core.management.setup_environ()`` (which is being deprecated in Django 1.4 anyway).

Now, funfactory.manage has this function still. Playdoh is asked to call it. So just renaming it is non-trivial. It no longer wraps ``django.core.management.setup_environ()``. What it does is:

1. Sets up paths (``site.addsitedir(...)`` etc)
2. Creates a ROOT variable that can be used in settings (...with the ``path()`` function)
3. Validates settings (e.g. asserts that ``settings.SECRET_KEY`` is set)

So a better name would be......? Yeah, what would it be?

Suppose we call it ``prepare_playdoh_stuff`` we'd also need to carefully deprecate it'd look something like this:

```python
# in funfactory/manage.py

def setup_environ(*args, **kwargs):
import warnings
warnings.warn(DeprecationWarning, "use prepare_playdoh_stuff() instead of setup_environ()")
prepare_playdoh_stuff(*args, **kwargs)

def prepare_playdoh_stuff(manage_file, settings=None):
...
```