stephenmcd/mezzanine — pull request #819 by acatton (2013-11-14 01:44:15+00:00)
Title: Fix importing Pages in a middleware

Hi,

We have a [middleware that falls back on certain template when there are no Django url](//github.com/fusionbox/django-fusionbox/blob/master/fusionbox/middleware.py#L50). We [wrote one that work with Mezzanine](//github.com/fusionbox/django-fusionbox/blob/master/fusionbox/mezzanine/middleware.py#L14).

I was using Mezzanine on one of my projects. And I had a bug when deploying with uwsgi and gunicorn, but I couldn't reproduce this bug locally. This is why I couldn't write test for this bug.

This is the error message:
```
Traceback (most recent call last):
File "lib/python2.7/site-packages/gunicorn/workers/sync.py", line 131, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 236, in __call__
self.load_middleware()
File "lib/python2.7/site-packages/django/core/handlers/base.py", line 53, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
ImproperlyConfigured: Error importing middleware fusionbox.mezzanine.middleware: "cannot import name Link"
```

Anyway, after a `git bisect` I found the [guilty commit](https://github.com/fusionbox/mezzanine/commit/19288b896a5ccb146ae8fe8e25cde5a768079c0d). We encountered a similar problem on [widgy](//github.com/fusionbox/django-widgy) and @gavinwahl [fixed it](//github.com/fusionbox/django-widgy/commit/4964243f7a3a03c4eb43453c1ed0371fc61c3e81). I applied the same fix to mezzanine.

Could you please review my change, and let me know if there is any problem.

Thanks!