Made app hooks work when using dynamic sites

See:
* https://bitbucket.org/uysrc/django-dynamicsites
* the DynamicSiteIDMiddleware from djangotoolbox: https://github.com/django-nonrel/djangotoolbox/blob/develop/djangotoolbox/sites/dynamicsite.py