Commit 62f17909 by bmedx

Fix several RemovedInDjango19Warning by re-ordering INSTALLED_APPS

- PLAT-1642
- PLAT-1643
parent 7f32e03d
...@@ -880,7 +880,10 @@ VIDEO_UPLOAD_PIPELINE = { ...@@ -880,7 +880,10 @@ VIDEO_UPLOAD_PIPELINE = {
############################ APPS ##################################### ############################ APPS #####################################
INSTALLED_APPS = ( # The order of INSTALLED_APPS is important, when adding new apps here
# remember to check that you are not creating new
# RemovedInDjango19Warnings in the test logs.
INSTALLED_APPS = [
# Standard apps # Standard apps
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
...@@ -908,6 +911,12 @@ INSTALLED_APPS = ( ...@@ -908,6 +911,12 @@ INSTALLED_APPS = (
# Testing # Testing
'django_nose', 'django_nose',
# Bookmarks
'openedx.core.djangoapps.bookmarks',
# Video module configs (This will be moved to Video once it becomes an XBlock)
'openedx.core.djangoapps.video_config',
# For CMS # For CMS
'contentstore.apps.ContentstoreConfig', 'contentstore.apps.ContentstoreConfig',
...@@ -983,6 +992,12 @@ INSTALLED_APPS = ( ...@@ -983,6 +992,12 @@ INSTALLED_APPS = (
'openedx.core.djangoapps.content.course_structures.apps.CourseStructuresConfig', 'openedx.core.djangoapps.content.course_structures.apps.CourseStructuresConfig',
'openedx.core.djangoapps.content.block_structure.apps.BlockStructureConfig', 'openedx.core.djangoapps.content.block_structure.apps.BlockStructureConfig',
# edx-milestones service
'milestones',
# Self-paced course configuration
'openedx.core.djangoapps.self_paced',
# Coursegraph # Coursegraph
'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig', 'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig',
...@@ -994,18 +1009,9 @@ INSTALLED_APPS = ( ...@@ -994,18 +1009,9 @@ INSTALLED_APPS = (
# edX Proctoring # edX Proctoring
'edx_proctoring', 'edx_proctoring',
# Bookmarks
'openedx.core.djangoapps.bookmarks',
# Catalog integration # Catalog integration
'openedx.core.djangoapps.catalog', 'openedx.core.djangoapps.catalog',
# Self-paced course configuration
'openedx.core.djangoapps.self_paced',
# Video module configs (This will be moved to Video once it becomes an XBlock)
'openedx.core.djangoapps.video_config',
# django-oauth2-provider (deprecated) # django-oauth2-provider (deprecated)
'provider', 'provider',
'provider.oauth2', 'provider.oauth2',
...@@ -1022,9 +1028,6 @@ INSTALLED_APPS = ( ...@@ -1022,9 +1028,6 @@ INSTALLED_APPS = (
# Microsite configuration application # Microsite configuration application
'microsite_configuration', 'microsite_configuration',
# edx-milestones service
'milestones',
# Static i18n support # Static i18n support
'statici18n', 'statici18n',
...@@ -1058,7 +1061,7 @@ INSTALLED_APPS = ( ...@@ -1058,7 +1061,7 @@ INSTALLED_APPS = (
# DRF filters # DRF filters
'django_filters', 'django_filters',
) ]
################# EDX MARKETING SITE ################################## ################# EDX MARKETING SITE ##################################
...@@ -1147,32 +1150,33 @@ MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60 ...@@ -1147,32 +1150,33 @@ MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60
### Apps only installed in some instances ### Apps only installed in some instances
# The order of INSTALLED_APPS matters, so this tuple is the app name and the item in INSTALLED_APPS
# that this app should be inserted *before*. A None here means it should be appended to the list.
OPTIONAL_APPS = ( OPTIONAL_APPS = (
'mentoring', ('mentoring', None),
'problem_builder', ('problem_builder', 'openedx.core.djangoapps.content.course_overviews'),
'edx_sga', ('edx_sga', None),
# edx-ora2 # edx-ora2
'submissions', ('submissions', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment', ('openassessment', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.assessment', ('openassessment.assessment', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.fileupload', ('openassessment.fileupload', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.workflow', ('openassessment.workflow', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.xblock', ('openassessment.xblock', 'openedx.core.djangoapps.content.course_overviews'),
# edxval # edxval
'edxval', ('edxval', 'openedx.core.djangoapps.content.course_overviews'),
# Organizations App (http://github.com/edx/edx-organizations) # Organizations App (http://github.com/edx/edx-organizations)
'organizations', ('organizations', None),
# Enterprise App (http://github.com/edx/edx-enterprise) # Enterprise App (http://github.com/edx/edx-enterprise)
'enterprise', ('enterprise', None),
) )
for app_name in OPTIONAL_APPS: for app_name, insert_before in OPTIONAL_APPS:
# First attempt to only find the module rather than actually importing it, # First attempt to only find the module rather than actually importing it,
# to avoid circular references - only try to import if it can't be found # to avoid circular references - only try to import if it can't be found
# by find_module, which doesn't work with import hooks # by find_module, which doesn't work with import hooks
...@@ -1183,7 +1187,12 @@ for app_name in OPTIONAL_APPS: ...@@ -1183,7 +1187,12 @@ for app_name in OPTIONAL_APPS:
__import__(app_name) __import__(app_name)
except ImportError: except ImportError:
continue continue
INSTALLED_APPS += (app_name,)
try:
INSTALLED_APPS.insert(INSTALLED_APPS.index(insert_before), app_name)
except (IndexError, ValueError):
INSTALLED_APPS += (app_name,)
### ADVANCED_SECURITY_CONFIG ### ADVANCED_SECURITY_CONFIG
# Empty by default # Empty by default
......
...@@ -1965,7 +1965,10 @@ YOUTUBE_API_KEY = None ...@@ -1965,7 +1965,10 @@ YOUTUBE_API_KEY = None
################################### APPS ###################################### ################################### APPS ######################################
INSTALLED_APPS = ( # The order of INSTALLED_APPS is important, when adding new apps here
# remember to check that you are not creating new
# RemovedInDjango19Warnings in the test logs.
INSTALLED_APPS = [
# Standard ones that are always installed... # Standard ones that are always installed...
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
...@@ -2012,6 +2015,12 @@ INSTALLED_APPS = ( ...@@ -2012,6 +2015,12 @@ INSTALLED_APPS = (
# Site configuration for theming and behavioral modification # Site configuration for theming and behavioral modification
'openedx.core.djangoapps.site_configuration', 'openedx.core.djangoapps.site_configuration',
# Video module configs (This will be moved to Video once it becomes an XBlock)
'openedx.core.djangoapps.video_config',
# Bookmarks
'openedx.core.djangoapps.bookmarks',
# Our courseware # Our courseware
'courseware', 'courseware',
'student', 'student',
...@@ -2158,6 +2167,7 @@ INSTALLED_APPS = ( ...@@ -2158,6 +2167,7 @@ INSTALLED_APPS = (
'openedx.core.djangoapps.content.block_structure.apps.BlockStructureConfig', 'openedx.core.djangoapps.content.block_structure.apps.BlockStructureConfig',
'lms.djangoapps.course_blocks', 'lms.djangoapps.course_blocks',
# Coursegraph # Coursegraph
'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig', 'openedx.core.djangoapps.coursegraph.apps.CoursegraphConfig',
...@@ -2181,9 +2191,6 @@ INSTALLED_APPS = ( ...@@ -2181,9 +2191,6 @@ INSTALLED_APPS = (
'xblock_django', 'xblock_django',
# Bookmarks
'openedx.core.djangoapps.bookmarks',
# programs support # programs support
'openedx.core.djangoapps.programs', 'openedx.core.djangoapps.programs',
...@@ -2213,9 +2220,6 @@ INSTALLED_APPS = ( ...@@ -2213,9 +2220,6 @@ INSTALLED_APPS = (
# Verified Track Content Cohorting (Beta feature that will hopefully be removed) # Verified Track Content Cohorting (Beta feature that will hopefully be removed)
'openedx.core.djangoapps.verified_track_content', 'openedx.core.djangoapps.verified_track_content',
# Video module configs (This will be moved to Video once it becomes an XBlock)
'openedx.core.djangoapps.video_config',
# Learner's dashboard # Learner's dashboard
'learner_dashboard', 'learner_dashboard',
...@@ -2255,7 +2259,7 @@ INSTALLED_APPS = ( ...@@ -2255,7 +2259,7 @@ INSTALLED_APPS = (
# DRF filters # DRF filters
'django_filters', 'django_filters',
) ]
######################### CSRF ######################################### ######################### CSRF #########################################
...@@ -2792,37 +2796,40 @@ ALL_LANGUAGES = ( ...@@ -2792,37 +2796,40 @@ ALL_LANGUAGES = (
### Apps only installed in some instances ### Apps only installed in some instances
# The order of INSTALLED_APPS matters, so this tuple is the app name and the item in INSTALLED_APPS
# that this app should be inserted *before*. A None here means it should be appended to the list.
OPTIONAL_APPS = ( OPTIONAL_APPS = (
'mentoring', ('mentoring', None),
'problem_builder', ('problem_builder', 'openedx.core.djangoapps.content.course_overviews'),
'edx_sga', ('edx_sga', None),
# edx-ora2 # edx-ora2
'submissions', ('submissions', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment', ('openassessment', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.assessment', ('openassessment.assessment', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.fileupload', ('openassessment.fileupload', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.workflow', ('openassessment.workflow', 'openedx.core.djangoapps.content.course_overviews'),
'openassessment.xblock', ('openassessment.xblock', 'openedx.core.djangoapps.content.course_overviews'),
# edxval # edxval
'edxval', ('edxval', 'openedx.core.djangoapps.content.course_overviews'),
# edX Proctoring # edX Proctoring
'edx_proctoring', ('edx_proctoring', None),
# Organizations App (http://github.com/edx/edx-organizations) # Organizations App (http://github.com/edx/edx-organizations)
'organizations', ('organizations', None),
# Enterprise Apps (http://github.com/edx/edx-enterprise) # Enterprise Apps (http://github.com/edx/edx-enterprise)
'enterprise', ('enterprise', None),
'integrated_channels.integrated_channel', ('integrated_channels.integrated_channel', None),
'integrated_channels.sap_success_factors', ('integrated_channels.sap_success_factors', None),
# Required by the Enterprise App # Required by the Enterprise App
'django_object_actions', # https://github.com/crccheck/django-object-actions ('django_object_actions', None), # https://github.com/crccheck/django-object-actions
) )
for app_name in OPTIONAL_APPS: for app_name, insert_before in OPTIONAL_APPS:
# First attempt to only find the module rather than actually importing it, # First attempt to only find the module rather than actually importing it,
# to avoid circular references - only try to import if it can't be found # to avoid circular references - only try to import if it can't be found
# by find_module, which doesn't work with import hooks # by find_module, which doesn't work with import hooks
...@@ -2833,7 +2840,11 @@ for app_name in OPTIONAL_APPS: ...@@ -2833,7 +2840,11 @@ for app_name in OPTIONAL_APPS:
__import__(app_name) __import__(app_name)
except ImportError: except ImportError:
continue continue
INSTALLED_APPS += (app_name,)
try:
INSTALLED_APPS.insert(INSTALLED_APPS.index(insert_before), app_name)
except (IndexError, ValueError):
INSTALLED_APPS += (app_name,)
### ADVANCED_SECURITY_CONFIG ### ADVANCED_SECURITY_CONFIG
# Empty by default # Empty by default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment