diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 242463aa07eae18a2933731543b9b88aa4df0a19..92e5deca3e24b5a2b0292ac67304cb48d7b3c6e3 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -127,3 +127,7 @@ YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YO # Generate a random UUID so that different runs of acceptance tests don't break each other import uuid SECRET_KEY = uuid.uuid4().hex + +############################### PIPELINE ####################################### + +PIPELINE_ENABLED = False diff --git a/cms/envs/common.py b/cms/envs/common.py index f1d34953a14a7f0e2c9d067e872c6194922a69f4..4427d551ce5606cdd7a9da747f40922430d8655d 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -455,6 +455,8 @@ EMBARGO_SITE_REDIRECT_URL = None ############################### PIPELINE ####################################### +PIPELINE_ENABLED = True + # Process static files using RequireJS Optimizer STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage' diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index bd003236688fe401615145da57d5cbd0fc448178..8abcaf1d330349b3c8d313bbf2e34d9c4f852ddd 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -34,6 +34,7 @@ FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE ########################### PIPELINE ################################# # Skip packaging and optimization in development +PIPELINE_ENABLED = False STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' # Revert to the default set of finders as we don't want the production pipeline diff --git a/cms/envs/test.py b/cms/envs/test.py index 16133ac8ef2b85c34219aa89b54903e92db4b5ac..7b18a1d42a159f16f5ca3dd35c6a3ea1779c0a37 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -92,7 +92,6 @@ STATICFILES_DIRS += [ # http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' STATIC_URL = "/static/" -PIPELINE_ENABLED = False TENDER_DOMAIN = "help.edge.edx.org" TENDER_SUBDOMAIN = "edxedge" diff --git a/common/djangoapps/pipeline_mako/__init__.py b/common/djangoapps/pipeline_mako/__init__.py index 97c17b6bf39a7d9dd0d9ba94fa70d49c63e3facb..c134da9cb1b041499c1af88cf66601944b8d07cc 100644 --- a/common/djangoapps/pipeline_mako/__init__.py +++ b/common/djangoapps/pipeline_mako/__init__.py @@ -14,7 +14,7 @@ def compressed_css(package_name, raw=False): package = packager.package_for('css', package_name) - if settings.PIPELINE: + if settings.PIPELINE_ENABLED: return render_css(package, package.output_filename, raw=raw) else: paths = packager.compile(package.paths) @@ -48,7 +48,7 @@ def compressed_js(package_name): package = packager.package_for('js', package_name) - if settings.PIPELINE: + if settings.PIPELINE_ENABLED: return render_js(package, package.output_filename) else: paths = packager.compile(package.paths) diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index 53fae641c564b92b7c7d6e81fe6c39d7372badc4..75f9cbec414f4ae785db6b843404e9a9a696d547 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -190,3 +190,7 @@ if FEATURES.get('ENABLE_COURSEWARE_SEARCH') or \ # Generate a random UUID so that different runs of acceptance tests don't break each other import uuid SECRET_KEY = uuid.uuid4().hex + +############################### PIPELINE ####################################### + +PIPELINE_ENABLED = False diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 9399a79e6cfc561476af98132838d92665605d31..3566c13970fe77206c2ce9abc934cec0aff364ac 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -131,9 +131,6 @@ if STATIC_URL_BASE: if not STATIC_URL.endswith("/"): STATIC_URL += "/" -# Enable uglification of JavaScript -PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.uglifyjs.UglifyJSCompressor' - # DEFAULT_COURSE_ABOUT_IMAGE_URL specifies the default image to show for courses that don't provide one DEFAULT_COURSE_ABOUT_IMAGE_URL = ENV_TOKENS.get('DEFAULT_COURSE_ABOUT_IMAGE_URL', DEFAULT_COURSE_ABOUT_IMAGE_URL) diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index c4115504e55610429f6f23685a6acf65b9237493..ac6a5fef742d5edbcdc6d2f240092ca636d1bb7d 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -74,6 +74,9 @@ DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' MEDIA_ROOT = TEST_ROOT / "uploads" MEDIA_URL = "/static/uploads/" +# Don't use compression during tests +PIPELINE_JS_COMPRESSOR = None + ################################# CELERY ###################################### CELERY_ALWAYS_EAGER = True diff --git a/lms/envs/common.py b/lms/envs/common.py index 41924c2217afda8c9db7230704c61185b318be40..13c0bf213c38697cbc25f1fd46ce81120cf806ac 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1207,6 +1207,8 @@ X_FRAME_OPTIONS = 'ALLOW' ############################### PIPELINE ####################################### +PIPELINE_ENABLED = True + # Process static files using RequireJS Optimizer STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCachedRequireJsStorage' @@ -1218,9 +1220,8 @@ STATICFILES_FINDERS = [ 'pipeline.finders.PipelineFinder', ] -# Don't use compression by default PIPELINE_CSS_COMPRESSOR = None -PIPELINE_JS_COMPRESSOR = None +PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.uglifyjs.UglifyJSCompressor' # Setting that will only affect the edX version of django-pipeline until our changes are merged upstream PIPELINE_COMPILE_INPLACE = True diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 34899a8ac75f19cac076f60703d3cca452069ce5..43fe3704fda4379ff2573a7b818a5ae42a116a8f 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -86,6 +86,7 @@ def should_show_debug_toolbar(_): ########################### PIPELINE ################################# # Skip packaging and optimization in development +PIPELINE_ENABLED = False STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' # Revert to the default set of finders as we don't want the production pipeline diff --git a/lms/envs/test.py b/lms/envs/test.py index 1e52d4297c09099fd99d2bfb007d1e61d303f766..b9c0f243b7b8bf5f4c07448db16779be6220db83 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -129,6 +129,8 @@ XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds MOCK_STAFF_GRADING = True MOCK_PEER_GRADING = True +############################ STATIC FILES ############################# + # TODO (cpennington): We need to figure out how envs/test.py can inject things # into common.py so that we don't have to repeat this sort of thing STATICFILES_DIRS = [ @@ -146,7 +148,9 @@ STATICFILES_DIRS += [ # find pipelined assets will raise a ValueError. # http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' -PIPELINE_ENABLED = False + +# Don't use compression during tests +PIPELINE_JS_COMPRESSOR = None update_module_store_settings( MODULESTORE, diff --git a/lms/templates/main_django.html b/lms/templates/main_django.html index 457dd672ed02f71380a771517146a2aad847abda..c8d2aac2d2d6f0827306fcafe532251ad53e974a 100644 --- a/lms/templates/main_django.html +++ b/lms/templates/main_django.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -{% load compressed %} +{% load pipeline %} {% load sekizai_tags i18n microsite %} {% load url from future %} {% load staticfiles %} @@ -10,13 +10,13 @@ <link rel="icon" type="image/x-icon" href="{% favicon_path %}" /> - {% compressed_css 'style-vendor' %} - {% compressed_css 'style-main' %} - {% compressed_css 'style-course-vendor' %} - {% compressed_css 'style-course' %} + {% stylesheet 'style-vendor' %} + {% stylesheet 'style-main' %} + {% stylesheet 'style-course-vendor' %} + {% stylesheet 'style-course' %} {% block main_vendor_js %} - {% compressed_js 'main_vendor' %} + {% javascript 'main_vendor' %} {% endblock %} {% block headextra %}{% endblock %} {% render_block "css" %} @@ -50,8 +50,8 @@ </div> - {% compressed_js 'application' %} - {% compressed_js 'module-js' %} + {% javascript 'application' %} + {% javascript 'module-js' %} {% render_block "js" %} </body> diff --git a/lms/templates/wiki/base.html b/lms/templates/wiki/base.html index 7191443c32b4e7830eade317b85f928e13027888..f64206fb6e28d767c6464c3723ae5271db59e372 100644 --- a/lms/templates/wiki/base.html +++ b/lms/templates/wiki/base.html @@ -1,5 +1,5 @@ {% extends "main_django.html" %} -{% load compressed %}{% load sekizai_tags i18n microsite %}{% load url from future %}{% load staticfiles %} +{% load pipeline %}{% load sekizai_tags i18n microsite %}{% load url from future %}{% load staticfiles %} {% block title %}<title>{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}</title>{% endblock %} @@ -7,7 +7,7 @@ {% block headextra %} <script type="text/javascript" src="/i18n.js"></script> - {% compressed_css 'course' %} + {% stylesheet 'course' %} <script type="text/javascript"> function ajaxError(){} diff --git a/lms/templates/wiki/preview_inline.html b/lms/templates/wiki/preview_inline.html index decd185b7d3ae4f34b7677569de53d4a8f9310c2..67e26234c2c6ca50d65dbeb930eae72c727f0df0 100644 --- a/lms/templates/wiki/preview_inline.html +++ b/lms/templates/wiki/preview_inline.html @@ -1,9 +1,9 @@ <!DOCTYPE html> -{% load wiki_tags i18n %}{% load compressed %} +{% load wiki_tags i18n %}{% load pipeline %} <html lang="{{LANGUAGE_CODE}}"> <head> - {% compressed_css 'course' %} - {% compressed_js 'main_vendor' %} + {% stylesheet 'course' %} + {% javascript 'main_vendor' %} </head> <body class="modal-preview"> <section class="container wiki view"> diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 9248926a1e1217d2cd3d852a2b5e07f32be5fca0..ef0c46f00fa8248062925624ec299414f0b81ec8 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -9,7 +9,7 @@ # Third-party: git+https://github.com/edx/django-staticfiles.git@031bdeaea85798b8c284e2a09977df3e32d06b5d#egg=django-staticfiles==1.2.1.0003 --e git+https://github.com/edx/django-pipeline.git@88ec8a011e481918fdc9d2682d4017c835acd8be#egg=django-pipeline +-e git+https://github.com/edx/django-pipeline.git@1.5.3+importfixes#egg=django-pipeline -e git+https://github.com/edx/django-wiki.git@cd0b2b31997afccde519fe5b3365e61a9edb143f#egg=django-wiki -e git+https://github.com/edx/django-oauth2-provider.git@0.2.7-fork-edx-5#egg=django-oauth2-provider -e git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=mongodb_proxy