From 015053cb9b8c3e6368ad8bc9385ea4ddf2b7df7f Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 28 Feb 2015 00:51:25 -0800 Subject: [PATCH 1/5] Remove antiquated LMS envs files These all date back to 2012 and are hard-coded for specific course runs. --- lms/envs/devgroups/__init__.py | 0 lms/envs/devgroups/courses.py | 48 ---------------------------------- lms/envs/devgroups/h_cs50.py | 8 ------ lms/envs/devgroups/m_6002.py | 8 ------ lms/envs/devgroups/portal.py | 17 ------------ 5 files changed, 81 deletions(-) delete mode 100644 lms/envs/devgroups/__init__.py delete mode 100644 lms/envs/devgroups/courses.py delete mode 100644 lms/envs/devgroups/h_cs50.py delete mode 100644 lms/envs/devgroups/m_6002.py delete mode 100644 lms/envs/devgroups/portal.py diff --git a/lms/envs/devgroups/__init__.py b/lms/envs/devgroups/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lms/envs/devgroups/courses.py b/lms/envs/devgroups/courses.py deleted file mode 100644 index edf7484bbf..0000000000 --- a/lms/envs/devgroups/courses.py +++ /dev/null @@ -1,48 +0,0 @@ - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from ..dev import * - -CLASSES_TO_DBS = { - 'BerkeleyX/CS169.1x/2012_Fall': "cs169.db", - 'BerkeleyX/CS188.1x/2012_Fall': "cs188_1.db", - 'HarvardX/CS50x/2012': "cs50.db", - 'HarvardX/PH207x/2012_Fall': "ph207.db", - 'MITx/3.091x/2012_Fall': "3091.db", - 'MITx/6.002x/2012_Fall': "6002.db", - 'MITx/6.00x/2012_Fall': "600.db", -} - - -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', - 'KEY_FUNCTION': 'util.memcache.safe_key', - }, - 'general': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', - 'KEY_PREFIX': 'general', - 'VERSION': 5, - 'KEY_FUNCTION': 'util.memcache.safe_key', - } -} - -SESSION_ENGINE = 'django.contrib.sessions.backends.cache' - - -def path_for_db(db_name): - return ENV_ROOT / "db" / db_name - - -def course_db_for(course_id): - db_name = CLASSES_TO_DBS[course_id] - return { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': path_for_db(db_name) - } - } diff --git a/lms/envs/devgroups/h_cs50.py b/lms/envs/devgroups/h_cs50.py deleted file mode 100644 index 2c64946a3f..0000000000 --- a/lms/envs/devgroups/h_cs50.py +++ /dev/null @@ -1,8 +0,0 @@ - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from .courses import * - -DATABASES = course_db_for('HarvardX/CS50x/2012') diff --git a/lms/envs/devgroups/m_6002.py b/lms/envs/devgroups/m_6002.py deleted file mode 100644 index 5df2a33440..0000000000 --- a/lms/envs/devgroups/m_6002.py +++ /dev/null @@ -1,8 +0,0 @@ - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from .courses import * - -DATABASES = course_db_for('MITx/6.002x/2012_Fall') diff --git a/lms/envs/devgroups/portal.py b/lms/envs/devgroups/portal.py deleted file mode 100644 index c570e555f3..0000000000 --- a/lms/envs/devgroups/portal.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -Note that for this to work at all, you must have memcached running (or you won't -get shared sessions) -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from lms.envs.devgroups.courses import * - -# Move this to a shared file later: -for class_id, db_name in CLASSES_TO_DBS.items(): - DATABASES[class_id] = { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': path_for_db(db_name) - } From 1dad4c8f9f09362aed34b1497f820237f6948d22 Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 28 Feb 2015 21:25:47 -0800 Subject: [PATCH 2/5] Remove edx4edx LMS env settings Is this used? It contains MITx references. --- lms/envs/edx4edx_aws.py | 42 ----------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 lms/envs/edx4edx_aws.py diff --git a/lms/envs/edx4edx_aws.py b/lms/envs/edx4edx_aws.py deleted file mode 100644 index 13a1e1b9f7..0000000000 --- a/lms/envs/edx4edx_aws.py +++ /dev/null @@ -1,42 +0,0 @@ -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -# Settings for edx4edx production instance -from .aws import * -COURSE_NAME = "edx4edx" -COURSE_NUMBER = "edX.01" -COURSE_TITLE = "edx4edx: edX Author Course" -EDX4EDX_ROOT = ENV_ROOT / "data/edx4edx" - -### Dark code. Should be enabled in local settings for devel. -ENABLE_MULTICOURSE = True # set to False to disable multicourse display (see lib.util.views.edxhome) -### -PIPELINE_CSS_COMPRESSOR = None -PIPELINE_JS_COMPRESSOR = None - -COURSE_DEFAULT = 'edx4edx' -COURSE_SETTINGS = { - 'edx4edx': { - 'number': 'edX.01', - 'title': 'edx4edx: edX Author Course', - 'xmlpath': '/edx4edx/', - 'github_url': 'https://github.com/MITx/edx4edx', - 'active': True, - 'default_chapter': 'Introduction', - 'default_section': 'edx4edx_Course', - }, -} - -STATICFILES_DIRS = [ - PROJECT_ROOT / "static", - ("edx4edx", EDX4EDX_ROOT / "html"), - ("circuits", DATA_DIR / "images"), - ("handouts", DATA_DIR / "handouts"), - ("subs", DATA_DIR / "subs"), - - # This is how you would use the textbook images locally - # ("book", ENV_ROOT / "book_images"), -] - -MAKO_TEMPLATES['course'] = [DATA_DIR, EDX4EDX_ROOT] From 88d9b87150091249401104555b2c0df1ea7e9e42 Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 28 Feb 2015 21:26:59 -0800 Subject: [PATCH 3/5] Remove dev_ike LMS env settings This looks to have been a personal configuration file. --- lms/envs/dev_ike.py | 54 --------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 lms/envs/dev_ike.py diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py deleted file mode 100644 index 9aea2f0e10..0000000000 --- a/lms/envs/dev_ike.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -This config file runs the simplest dev environment using sqlite, and db-based -sessions. Assumes structure: - -/envroot/ - /db # This is where it'll write the database file - /edx-platform # The location of this repo - /log # Where we're going to write log files -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from .common import * -from .dev import * -import socket - -WIKI_ENABLED = False -FEATURES['ENABLE_TEXTBOOK'] = False -FEATURES['ACCESS_REQUIRE_STAFF_FOR_COURSE'] = True # require that user be in the staff_* group to be able to enroll -FEATURES['SUBDOMAIN_COURSE_LISTINGS'] = False -FEATURES['SUBDOMAIN_BRANDING'] = False -FEATURES['FORCE_UNIVERSITY_DOMAIN'] = None # show all university courses if in dev (ie don't use HTTP_HOST) - -FEATURES['DISABLE_START_DATES'] = True -# FEATURES['USE_DJANGO_PIPELINE']=False # don't recompile scss - -myhost = socket.gethostname() -if ('edxvm' in myhost) or ('ocw' in myhost): - FEATURES['DISABLE_LOGIN_BUTTON'] = True # auto-login with MIT certificate - FEATURES['USE_XQA_SERVER'] = 'https://qisx.mit.edu/xqa' # needs to be ssl or browser blocks it - FEATURES['USE_DJANGO_PIPELINE'] = False # don't recompile scss - -if ('ocw' in myhost): - FEATURES['ACCESS_REQUIRE_STAFF_FOR_COURSE'] = False - -if ('domU' in myhost): - EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' - FEATURES['REROUTE_ACTIVATION_EMAIL'] = 'ichuang@edX.mit.edu' # nonempty string = address for all activation emails - FEATURES['USE_DJANGO_PIPELINE'] = False # don't recompile scss - -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') # django 1.4 for nginx ssl proxy - -#----------------------------------------------------------------------------- -# disable django debug toolbars - -INSTALLED_APPS = tuple([app for app in INSTALLED_APPS if not app.startswith('debug_toolbar')]) -MIDDLEWARE_CLASSES = tuple([mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startswith('debug_toolbar')]) -#TEMPLATE_LOADERS = tuple([ app for app in TEMPLATE_LOADERS if not app.startswith('edxmako') ]) -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -) From aae9e821ed14e2ec5852518305bab8f0cc3bb847 Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 28 Feb 2015 21:27:55 -0800 Subject: [PATCH 4/5] Remove dev_int LMS env settings This contains hard-coded reference to out-dated courses. --- lms/envs/dev_int.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 lms/envs/dev_int.py diff --git a/lms/envs/dev_int.py b/lms/envs/dev_int.py deleted file mode 100644 index f6e5ef028e..0000000000 --- a/lms/envs/dev_int.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -This enables use of course listings by subdomain. To see it in action, point the -following domains to 127.0.0.1 in your /etc/hosts file: - - berkeley.dev - harvard.dev - mit.dev - -Note that OS X has a bug where using *.local domains is excruciatingly slow, so -use *.dev domains instead for local testing. -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -from .dev import * - -FEATURES['SUBDOMAIN_COURSE_LISTINGS'] = True - -COURSE_LISTINGS = { - 'default': ['BerkeleyX/CS169.1x/2012_Fall', - 'BerkeleyX/CS188.1x/2012_Fall', - 'HarvardX/CS50x/2012', - 'HarvardX/PH207x/2012_Fall', - 'MITx/3.091x/2012_Fall', - 'MITx/6.002x/2012_Fall', - 'MITx/6.00x/2012_Fall'], - - 'berkeley': ['BerkeleyX/CS169.1x/2012_Fall', - 'BerkeleyX/CS188.1x/2012_Fall'], - - 'harvard': ['HarvardX/CS50x/2012'], - - 'mit': ['MITx/3.091x/2012_Fall', - 'MITx/6.00x/2012_Fall'] -} From 261629d7dd880ba54c1e34b6938aa4dd246b8e4a Mon Sep 17 00:00:00 2001 From: stv Date: Sat, 14 Mar 2015 11:10:39 -0700 Subject: [PATCH 5/5] Copy over context from settings file Instead of referencing the example externally, we now explain the setting inline. --- lms/envs/common.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 14d998b060..18955a4dd7 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -80,10 +80,22 @@ FEATURES = { ## Doing so will cause all courses to be released on production 'DISABLE_START_DATES': False, # When True, all courses will be active, regardless of start date - # When True, will only publicly list courses by the subdomain. Expects you - # to define COURSE_LISTINGS, a dictionary mapping subdomains to lists of - # course_ids (see dev_int.py for an example) + # When True, will only publicly list courses by the subdomain. 'SUBDOMAIN_COURSE_LISTINGS': False, + # Expects you to define COURSE_LISTINGS, a dictionary mapping + # subdomains to lists of course_ids + # COURSE_LISTINGS = { + # 'default': [ + # 'BerkeleyX/CS169.1x/2012_Fall', + # 'HarvardX/CS50x/2012', + # 'MITx/3.091x/2012_Fall', + # ], + # 'openedx': [ + # 'BerkeleyX/CS169.1x/2012_Fall', + # ], + # } + # To see it in action, add the following to your /etc/hosts file: + # 127.0.0.1 openedx.dev # When True, will override certain branding with university specific values # Expects a SUBDOMAIN_BRANDING dictionary that maps the subdomain to the