Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cms/envs/acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ def seed():
}

# Enable asset pipeline
# Our fork of django-pipeline uses `PIPELINE` instead of `PIPELINE_ENABLED`
# PipelineFinder is explained here: http://django-pipeline.readthedocs.org/en/1.1.24/storages.html
PIPELINE = True
PIPELINE_ENABLED = True
STATICFILES_FINDERS += ('pipeline.finders.PipelineFinder', )

# Use the auto_auth workflow for creating users and logging them in
Expand Down
9 changes: 4 additions & 5 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
############################ FEATURE CONFIGURATION #############################

FEATURES = {
'USE_DJANGO_PIPELINE': True,

'GITHUB_PUSH': False,

'ENABLE_DISCUSSION_SERVICE': False,
Expand Down Expand Up @@ -134,8 +132,8 @@
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)

Expand Down Expand Up @@ -243,6 +241,7 @@
############################### Pipeline #######################################

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_ENABLED = True

from rooted_paths import rooted_glob

Expand Down Expand Up @@ -404,7 +403,7 @@
# For asset pipelining
'edxmako',
'pipeline',
'staticfiles',
'django.contrib.staticfiles',
'static_replace',

# comment common
Expand Down
2 changes: 1 addition & 1 deletion cms/envs/dev_ike.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

FEATURES['AUTH_USE_MIT_CERTIFICATES'] = True

FEATURES['USE_DJANGO_PIPELINE'] = False # don't recompile scss
PIPELINE_ENABLED = False # don't recompile scss

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') # django 1.4 for nginx ssl proxy
2 changes: 1 addition & 1 deletion common/djangoapps/pipeline_js/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
from django.conf import settings
from django.http import HttpResponse
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
from edxmako.shortcuts import render_to_response


Expand Down
4 changes: 2 additions & 2 deletions common/djangoapps/pipeline_mako/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def compressed_css(package_name):

package = packager.package_for('css', package_name)

if settings.PIPELINE:
if getattr(settings, "PIPELINE_ENABLED", False):
return render_css(package, package.output_filename)
else:
paths = packager.compile(package.paths)
Expand Down Expand Up @@ -46,7 +46,7 @@ def compressed_js(package_name):

package = packager.package_for('js', package_name)

if settings.PIPELINE:
if getattr(settings, "PIPELINE_ENABLED", False):
return render_js(package, package.output_filename)
else:
paths = packager.compile(package.paths)
Expand Down
6 changes: 3 additions & 3 deletions common/djangoapps/pipeline_mako/templates/static_content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%!
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
from pipeline_mako import compressed_css, compressed_js
%>

Expand All @@ -11,7 +11,7 @@
%>${url}</%def>

<%def name='css(group)'>
% if settings.FEATURES['USE_DJANGO_PIPELINE']:
% if getattr(settings, "PIPELINE_ENABLED", False):
${compressed_css(group)}
% else:
% for filename in settings.PIPELINE_CSS[group]['source_filenames']:
Expand All @@ -20,7 +20,7 @@
%endif
</%def>
<%def name='js(group)'>
% if settings.FEATURES['USE_DJANGO_PIPELINE']:
% if getattr(settings, "PIPELINE_ENABLED", False):
${compressed_js(group)}
% else:
% for filename in settings.PIPELINE_JS[group]['source_filenames']:
Expand Down
4 changes: 2 additions & 2 deletions common/djangoapps/static_replace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
import re

from staticfiles.storage import staticfiles_storage
from staticfiles import finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles import finders
from django.conf import settings

from xmodule.modulestore.django import modulestore
Expand Down
16 changes: 0 additions & 16 deletions common/djangoapps/terrain/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@
import xmodule.modulestore.django
from xmodule.contentstore.django import _CONTENTSTORE

# There is an import issue when using django-staticfiles with lettuce
# Lettuce assumes that we are using django.contrib.staticfiles,
# but the rest of the app assumes we are using django-staticfiles
# (in particular, django-pipeline and our mako implementation)
# To resolve this, we check whether staticfiles is installed,
# then redirect imports for django.contrib.staticfiles
# to use staticfiles.
try:
import staticfiles
import staticfiles.handlers
except ImportError:
pass
else:
import sys
sys.modules['django.contrib.staticfiles'] = staticfiles
sys.modules['django.contrib.staticfiles.handlers'] = staticfiles.handlers

LOGGER = getLogger(__name__)
LOGGER.info("Loading the lettuce acceptance testing terrain file...")
Expand Down
5 changes: 2 additions & 3 deletions lms/envs/acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ def seed():


# Enable asset pipeline
# Our fork of django-pipeline uses `PIPELINE` instead of `PIPELINE_ENABLED`
# PipelineFinder is explained here: http://django-pipeline.readthedocs.org/en/1.1.24/storages.html
PIPELINE = True
# PipelineFinder is explained here: http://django-pipeline.readthedocs.org/en/1.3.16/storages.html
PIPELINE_ENABLED = True
STATICFILES_FINDERS += ('pipeline.finders.PipelineFinder', )

BULK_EMAIL_DEFAULT_FROM_EMAIL = "test@test.org"
Expand Down
8 changes: 4 additions & 4 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
# Features
FEATURES = {
'SAMPLE': False,
'USE_DJANGO_PIPELINE': True,
'DISPLAY_HISTOGRAMS_TO_STAFF': True,
'REROUTE_ACTIVATION_EMAIL': False, # nonempty string = address for all activation emails
'DEBUG_LEVEL': 0, # 0 = lowest level, least verbose, 255 = max level, most verbose
Expand Down Expand Up @@ -203,6 +202,7 @@
# only edX superusers can perform the downloads)
'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False,
}
PIPELINE_ENABLED = True

# Used for A/B testing
DEFAULT_GROUPS = []
Expand Down Expand Up @@ -587,8 +587,8 @@
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
)

Expand Down Expand Up @@ -936,7 +936,7 @@
# For asset pipelining
'edxmako',
'pipeline',
'staticfiles',
'django.contrib.staticfiles',
'static_replace',

# Our courseware
Expand Down
6 changes: 3 additions & 3 deletions lms/envs/dev_ike.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
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
# PIPELINE_ENABLED = 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
PIPELINE_ENABLED = 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
PIPELINE_ENABLED = False # don't recompile scss

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') # django 1.4 for nginx ssl proxy

Expand Down
2 changes: 1 addition & 1 deletion lms/envs/devplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
'debug_toolbar.panels.profiling.ProfilingDebugPanel',
)

#PIPELINE = True
#PIPELINE_ENABLED = True
1 change: 1 addition & 0 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ django-model-utils==1.4.0
django-masquerade==0.1.6
django-mptt==0.5.5
django-openid-auth==0.4
django-pipeline==1.3.19

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtauber You should be aware that this PR removes our forked version of django-staticfiles from the codebase entirely (using Django's built-in django.contrib.staticfiles package instead), and replaces our forked version of django-pipeline with version 1.3.19 of the mainline project.

django-robots==0.9.1
django-sekizai==0.6.1
django-ses==0.4.1
Expand Down
2 changes: 0 additions & 2 deletions requirements/edx/github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# Python libraries to install directly from github

# Third-party:
-e git+https://github.com/edx/django-staticfiles.git@d89aae2a82f2b#egg=django-staticfiles
-e git+https://github.com/edx/django-pipeline.git@88ec8a011e481918fdc9d2682d4017c835acd8be#egg=django-pipeline
-e git+https://github.com/edx/django-wiki.git@41815e2ef1b0323f92900f8e60711b0f0c37766b#egg=django-wiki
-e git+https://github.com/edx/lettuce.git@503fe2d2599290c45b021d6c424ab5ea899e42be#egg=lettuce
-e git+https://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev
Expand Down