devstack_optimized.py 1.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
"""
Settings to run LMS in devstack using optimized static assets.

This configuration changes LMS to use the optimized static assets generated for testing,
rather than picking up the files directly from the source tree.

The following Paver command can be used to run LMS in optimized mode:

  paver devstack lms --optimized

You can also generate the assets explicitly and then run Studio:

  paver update_assets lms --settings=test_static_optimized
  paver devstack lms --settings=devstack_optimized --fast

Note that changes to JavaScript assets will not be picked up automatically
as they are for non-optimized devstack. Instead, update_assets must be
invoked each time that changes have been made.
"""

########################## Devstack settings ###################################

from .devstack import *  # pylint: disable=wildcard-import, unused-wildcard-import

25
TEST_ROOT = REPO_ROOT / "test_root"
26 27 28 29 30 31

############################ STATIC FILES #############################

# Enable debug so that static assets are served by Django
DEBUG = True

32 33 34
# Set REQUIRE_DEBUG to false so that it behaves like production
REQUIRE_DEBUG = False

35 36 37
# Fetch static files out of the pipeline's static root
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

38 39 40 41
#  Serve static files at /static directly from the staticfiles directory under test root.
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
42
    'django.contrib.staticfiles.finders.FileSystemFinder',
43
)
44
STATICFILES_DIRS = [
45
    (TEST_ROOT / "staticfiles" / "lms").abspath(),
46
]