Don't force modulestore initialization when running lms manage.py, only when running via the wsgi file

This commit is contained in:
Calen Pennington
2014-01-24 12:42:08 -05:00
parent 7110500e79
commit 7c758ec982
2 changed files with 11 additions and 7 deletions

View File

@@ -8,21 +8,15 @@ from django.conf import settings
settings.INSTALLED_APPS # pylint: disable=W0104
from django_startup import autostartup
from xmodule.modulestore.django import modulestore
import edxmako
def run():
"""
Executed during django startup
"""
autostartup()
# Trigger a forced initialization of our modulestores since this can take a
# while to complete and we want this done before HTTP requests are accepted.
if settings.INIT_MODULESTORE_ON_STARTUP:
for store_name in settings.MODULESTORE:
modulestore(store_name)
if settings.FEATURES.get('USE_CUSTOM_THEME', False):
enable_theme()

View File

@@ -5,6 +5,16 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws")
import lms.startup as startup
startup.run()
from django.conf import settings
from xmodule.modulestore.django import modulestore
# Trigger a forced initialization of our modulestores since this can take a
# while to complete and we want this done before HTTP requests are accepted.
if settings.INIT_MODULESTORE_ON_STARTUP:
for store_name in settings.MODULESTORE:
modulestore(store_name)
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from django.core.wsgi import get_wsgi_application