Use django.contrib.staticfiles instead of django-staticfiles.

TNL-3137
This commit is contained in:
Usman Khalid
2015-09-08 01:47:11 +05:00
parent 130bbd7993
commit dbcd1bf430
23 changed files with 33 additions and 51 deletions

View File

@@ -62,7 +62,7 @@ DEBUG = True
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
)
STATICFILES_DIRS = (
(TEST_ROOT / "staticfiles" / "cms").abspath(),

View File

@@ -466,8 +466,8 @@ STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCa
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
@@ -742,7 +742,7 @@ INSTALLED_APPS = (
# For asset pipelining
'edxmako',
'pipeline',
'staticfiles',
'django.contrib.staticfiles',
'static_replace',
'require',

View File

@@ -39,8 +39,8 @@ STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
############################# ADVANCED COMPONENTS #############################

View File

@@ -36,7 +36,7 @@ REQUIRE_DEBUG = False
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
)
STATICFILES_DIRS = (
(TEST_ROOT / "staticfiles" / "cms").abspath(),

View File

@@ -28,8 +28,8 @@ STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCa
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo

View File

@@ -4,7 +4,7 @@ Views for returning XModule JS (used by requirejs)
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

View File

@@ -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
from django.utils.translation import get_language_bidi
from mako.exceptions import TemplateLookupException

View File

@@ -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

View File

@@ -19,23 +19,6 @@ from json import dumps
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...")

View File

@@ -84,9 +84,9 @@ MOCK_MODULES = [
'ratelimitbackend',
'analytics',
'courseware.courses',
'staticfiles',
'django.contrib.staticfiles',
'storage',
'staticfiles.storage',
'django.contrib.staticfiles.storage',
'content',
'xmodule.contentstore',
'xmodule.contentstore.content',

View File

@@ -4,7 +4,7 @@ from django.conf import settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from microsite_configuration import microsite
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
def get_visible_courses():

View File

@@ -17,7 +17,7 @@ import urlparse
from django.conf import settings
from django.utils.translation import ugettext as _
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
from microsite_configuration import microsite
from edxmako.shortcuts import marketing_link

View File

@@ -10,7 +10,7 @@ from django.http import HttpResponse, Http404
from django.utils import translation
from django.shortcuts import redirect
from django.views.decorators.csrf import ensure_csrf_cookie
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
from edxmako.shortcuts import render_to_response
import student.views

View File

@@ -5,7 +5,7 @@ from django.conf import settings
from django.test import TestCase
from path import path # pylint: disable=no-name-in-module
import staticfiles
from django.contrib import staticfiles
from openedx.core.djangoapps.theming.test_util import with_comp_theme
from openedx.core.lib.tempdir import mkdtemp_clean

View File

@@ -57,7 +57,7 @@ from verify_student.image import decode_image_data, InvalidImageData
from util.json_request import JsonResponse
from util.date_utils import get_default_time_display
from xmodule.modulestore.django import modulestore
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
log = logging.getLogger(__name__)

View File

@@ -64,7 +64,7 @@ DEBUG = True
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
)
STATICFILES_DIRS = (
(TEST_ROOT / "staticfiles" / "lms").abspath(),

View File

@@ -1203,8 +1203,8 @@ STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCa
# List of finder classes that know how to find static files in various locations.
# Note: the pipeline finder is included to be able to discover optimized files
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'pipeline.finders.PipelineFinder',
]
@@ -1813,7 +1813,7 @@ INSTALLED_APPS = (
# For asset pipelining
'edxmako',
'pipeline',
'staticfiles',
'django.contrib.staticfiles',
'static_replace',
# Theming

View File

@@ -91,8 +91,8 @@ STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage'
# Revert to the default set of finders as we don't want the production pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
# Disable JavaScript compression in development

View File

@@ -36,7 +36,7 @@ REQUIRE_DEBUG = False
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
'staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
)
STATICFILES_DIRS = (
(TEST_ROOT / "staticfiles" / "lms").abspath(),

View File

@@ -39,8 +39,8 @@ STATICFILES_STORAGE = 'openedx.core.lib.django_require.staticstorage.OptimizedCa
# Revert to the default set of finders as we don't want to dynamically pick up files from the pipeline
STATICFILES_FINDERS = [
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
# Redirect to the test_root folder within the repo

View File

@@ -12,7 +12,7 @@ import HTMLParser
from django.conf import settings
from django.contrib.auth.models import User
from staticfiles import finders
from django.contrib.staticfiles import finders
from django.core.cache import cache
from django.core.mail import EmailMessage
from django.core.urlresolvers import reverse

View File

@@ -6,7 +6,7 @@ import hashlib
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from staticfiles.storage import staticfiles_storage
from django.contrib.staticfiles.storage import staticfiles_storage
from microsite_configuration import microsite

View File

@@ -8,8 +8,7 @@
# Python libraries to install directly from github
# 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@1.5.3+importfixes#egg=django-pipeline
-e git+https://github.com/cyberdelia/django-pipeline.git@1.5.3#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/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth
@@ -41,7 +40,7 @@ git+https://github.com/edx/rfc6266.git@v0.0.5-edx#egg=rfc6266==0.0.5-edx
-e git+https://github.com/edx/event-tracking.git@0.2.0#egg=event-tracking
-e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash
-e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock
-e git+https://github.com/edx/edx-ora2.git@release-2015-09-16T15.28#egg=edx-ora2
-e git+https://github.com/edx/edx-ora2.git@release-2015-09-22T15.43#egg=edx-ora2
-e git+https://github.com/edx/edx-submissions.git@0.1.0#egg=edx-submissions
-e git+https://github.com/edx/opaque-keys.git@27dc382ea587483b1e3889a3d19cbd90b9023a06#egg=opaque-keys
git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3