I'm writing a quick Django module and want to check for another module. Is there's a shortcut to check if another module is in the installed_apps list in Django's settings?
+4
A:
from settings import INSTALLED_APPS
if 'appname' in INSTALLED_APPS:
print 'we have app'
And this way is somewhat how Django itself does. Also check the load_app
method on the linked page.
inerte
2009-08-18 06:19:44
I knew there was a nice simple syntax for it... I'm tired...
Gabriel Hurley
2009-08-18 06:32:16