Files
edx-platform/common/lib/django_startup.py
Calen Pennington 407b02b358 Centralize startup code, and execute in all contexts
Inspired by: http://eldarion.com/blog/2013/02/14/entry-point-hook-django-projects/
Moves startup code to lms.startup and cms.startup, and calls the startup
methods in wsgi.py and manage.py for both projects.
2013-08-27 12:12:20 -04:00

15 lines
375 B
Python

from importlib import import_module
from django.conf import settings
def autostartup():
"""
Execute app.startup:run() for all installed django apps
"""
for app in settings.INSTALLED_APPS:
try:
mod = import_module('{}.startup')
if hasattr(mod, 'run'):
mod.run()
except ImportError:
continue