startup.py 549 Bytes
Newer Older
1 2 3
"""
Module with code executed during Studio startup
"""
Calen Pennington committed
4
import logging
5 6 7 8 9 10 11
from django.conf import settings

# Force settings to run so that the python path is modified
settings.INSTALLED_APPS  # pylint: disable=W0104

from django_startup import autostartup

Calen Pennington committed
12 13
log = logging.getLogger(__name__)

14 15 16 17 18 19 20 21 22 23 24 25 26 27
# TODO: Remove this code once Studio/CMS runs via wsgi in all environments
INITIALIZED = False


def run():
    """
    Executed during django startup
    """
    global INITIALIZED
    if INITIALIZED:
        return

    INITIALIZED = True
    autostartup()