from importlib import import_module
from django.conf import settings
for app in settings.INSTALLED_APPS:
try:
import_module( 'signals', app)
except ImportError as e:
print 'Failed to import "%s", reason: %s' % (app, str(e)))
Original: http://djangosnippets.org/snippets/2561/
No comments:
Post a Comment