summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Maliński <riklaunim@gmail.com>2015-07-07 18:28:08 (GMT)
committerPiotr Maliński <riklaunim@gmail.com>2015-07-07 18:28:08 (GMT)
commit08b543d79def7b1b763d772d4d0595e1afff900a (patch)
tree47c5d312f9bdd7b6feef7506ef7b7fa9ef5fd07b
parent5e559d180f51f11021e47e1dd25dd23fa89032b0 (diff)
downloaddjango-ckeditor-08b543d79def7b1b763d772d4d0595e1afff900a.zip
django-ckeditor-08b543d79def7b1b763d772d4d0595e1afff900a.tar.gz
django-ckeditor-08b543d79def7b1b763d772d4d0595e1afff900a.tar.bz2
[#192] Add example configuration for using cache file storage in demo application.
-rw-r--r--ckeditor_demo/settings.py12
-rw-r--r--ckeditor_demo/urls.py2
2 files changed, 12 insertions, 2 deletions
diff --git a/ckeditor_demo/settings.py b/ckeditor_demo/settings.py
index b255445..fb3772b 100644
--- a/ckeditor_demo/settings.py
+++ b/ckeditor_demo/settings.py
@@ -27,8 +27,16 @@ TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
-#DEFAULT_FILE_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
-#STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
+CACHED_STORAGE = False
+
+if CACHED_STORAGE:
+ DEFAULT_FILE_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
+ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
+ STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+ 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+ )
# Application definition
diff --git a/ckeditor_demo/urls.py b/ckeditor_demo/urls.py
index 0e699f3..60a1db3 100644
--- a/ckeditor_demo/urls.py
+++ b/ckeditor_demo/urls.py
@@ -1,6 +1,7 @@
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
+from django.contrib.staticfiles import views
from django.contrib import admin
admin.autodiscover()
@@ -10,4 +11,5 @@ urlpatterns = patterns(
url(r'^$', 'ckeditor_demo.demo_application.views.ckeditor_form_view', name='ckeditor-form'),
url(r'^admin/', include(admin.site.urls)),
url(r'^ckeditor/', include('ckeditor.urls')),
+ url(r'^static/(?P<path>.*)$', views.serve),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)