Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
serve assets on devstack
Browse files Browse the repository at this point in the history
  • Loading branch information
mulby committed Dec 29, 2016
1 parent a90fdb7 commit e54e840
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions analytics_dashboard/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
########## DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
ENABLE_INSECURE_STATIC_FILES = False
########## END DEBUG CONFIGURATION


Expand Down
12 changes: 7 additions & 5 deletions analytics_dashboard/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
from analytics_dashboard.settings.yaml_config import *
from analytics_dashboard.settings.logger import get_logger_config

# Enable offline compression of CSS/JS
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True

# Use r.js to combine RequireJS files
RJS_OPTIMIZATION_ENABLED = True
if not DEBUG:
# Enable offline compression of CSS/JS
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True

# Use r.js to combine RequireJS files
RJS_OPTIMIZATION_ENABLED = True

# Minify CSS
COMPRESS_CSS_FILTERS += [
Expand Down
6 changes: 6 additions & 0 deletions analytics_dashboard/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.views import defaults
from django.views.generic import RedirectView
from django.views.i18n import javascript_catalog
from django.contrib.staticfiles import views as static_views

# pylint suggests importing analytics_dashboard.core, which causes errors in our AMI
# pylint: disable=relative-import
Expand Down Expand Up @@ -67,3 +68,8 @@ def debug_permission_denied(request):
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]

if settings.ENABLE_INSECURE_STATIC_FILES:
urlpatterns += [
url(r'^static/(?P<path>.*)$', static_views.serve),
]

0 comments on commit e54e840

Please sign in to comment.