stephenmcd/mezzanine — pull request #322 by eht16 (2012-07-15 16:53:24+00:00)
Title: Support modules within packages when trying to import host specific them...

...es

According to http://docs.python.org/library/functions.html#__import__
__import__ only returns the top-level package which might not be what we want for
the HOST_THEMES mapping. Looking the import module path up in sys.modules gives
the full path.

With this change it is possible to do use example_com.mybest as a host theme for
mybest.example.com (with main site example_com). Otherwise host_theme_path()
would return 'example_com' when trying to import 'example_com.mybest'.

To be honest, I tested this that this won't break anything but I'm not 100% sure.