def enter_lms(venv_path, edx_path): """ This will activate the edx virtual environment, and setup the environment as though the script was included in the lms project. """ # pylint: disable=F0401 use_edx_venv(venv_path) sys.path.append(edx_path) os.environ['DJANGO_SETTINGS_MODULE'] = 'lms.envs.aws' os.environ['SERVICE_VARIANT'] = 'lms' import lms.startup as startup startup.run()
# Patch the xml libs from safe_lxml import defuse_xml_libs defuse_xml_libs() # Disable PyContract contract checking when running as a webserver import contracts # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position contracts.disable_all() import os # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws") import lms.startup as startup # lint-amnesty, pylint: disable=wrong-import-position startup.run() from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-position # 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. modulestore() # 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 # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position application = get_wsgi_application()
# Patch the xml libs from safe_lxml import defuse_xml_libs defuse_xml_libs() # Disable PyContract contract checking when running as a webserver import contracts contracts.disable_all() import openedx.core.operations openedx.core.operations.install_memory_dumper() import os 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. modulestore() # 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 application = get_wsgi_application()