Merge pull request #16494 from edx/jeskew/remove_autostartup_call_code

Remove everything from CMS/LMS startup.py except single monkey-patch.
This commit is contained in:
John Eskew
2017-11-08 14:03:26 -05:00
committed by GitHub
4 changed files with 16 additions and 70 deletions

View File

@@ -12,3 +12,15 @@ class CommonInitializationConfig(AppConfig):
def ready(self):
# Common settings validations for the LMS and CMS.
from . import checks
self._add_mimetypes()
def _add_mimetypes(self):
"""
Add extra mimetypes. Used in xblock_resource.
"""
import mimetypes
mimetypes.add_type('application/vnd.ms-fontobject', '.eot')
mimetypes.add_type('application/x-font-opentype', '.otf')
mimetypes.add_type('application/x-font-ttf', '.ttf')
mimetypes.add_type('application/font-woff', '.woff')

View File

@@ -1,23 +0,0 @@
"""
Automatic execution of startup modules in Django apps.
"""
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:
# See if there's a startup module in each app.
try:
mod = import_module(app + '.startup')
except ImportError:
continue
# If the module has a run method, run it.
if hasattr(mod, 'run'):
mod.run()