Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated testproject to use `django.contrib.staticfiles`, updated defa…

…ult settings to use `STATIC_URL` if available
  • Loading branch information...
commit 4733800465427b17eb1dea274c9393b9209db21a 1 parent 26fdc5b
@stefanfoulis authored
View
9 HISTORY
@@ -1,10 +1,15 @@
Changelog for django-filer
-=============================
+==========================
next
----
* seperate, customizable file storage backends for public and private files
+* backwards incompatible changes
+ * storage refactor: path to files in the db has changed (no longer relative to MEDIA_ROOT)
+ * `filer.server.urls` needs to be included to serve private files
+ * static media has been moved from 'media' to 'static'
+ (as proposed by django-staticmedia and django 1.3)
0.8.2
@@ -18,7 +23,7 @@ next
* moved to easy-thumbnails for thumbnailing. added tests and lots of cleanup.
* Backwards incompatible changes:
- * use easy-thumbnails instead of sorl.thumbnail
+ * use easy-thumbnails instead of sorl.thumbnail
0.7.0
-----
View
12 buildout.cfg
@@ -3,6 +3,7 @@ verbosity=5
versions = versions
parts =
django
+ django_git
easy_thumbnails_git
develop =
.
@@ -14,7 +15,8 @@ eggs =
extra-paths = ${buildout:directory}
[versions]
-django = 1.2.4
+django =
+easy_thumbnails =
[django]
recipe = djangoprojectrecipe
@@ -23,8 +25,14 @@ settings = filer.testsettings
eggs = ${buildout:eggs}
extra-paths = ${buildout:extra-paths}
+[django_git]
+recipe = zerokspot.recipe.git
+repository = git://github.com/django/django.git
+as_egg = true
+rev = f5a1d03b6868091d28f12543efb27824e7ab750c
+
[easy_thumbnails_git]
recipe = zerokspot.recipe.git
-repository = https://github.com/SmileyChris/easy-thumbnails.git
+repository = git://github.com/SmileyChris/easy-thumbnails.git
as_egg = true
rev = f7e7eb00946d8de560dc8c8caabdef80a41bffb6
View
5 filer/admin/imageadmin.py
@@ -4,6 +4,7 @@
from filer.models import Image
from django.conf import settings
+from filer import settings as filer_settings
# forms
class ImageAdminFrom(forms.ModelForm):
@@ -27,8 +28,8 @@ class Media:
#'all': (settings.MEDIA_URL + 'filer/css/focal_point.css',)
}
js = (
- settings.MEDIA_URL + 'filer/js/raphael.js',
- settings.MEDIA_URL + 'filer/js/focal_point.js',
+ filer_settings.FILER_STATICMEDIA_PREFIX + 'js/raphael.js',
+ filer_settings.FILER_STATICMEDIA_PREFIX + 'js/focal_point.js',
)
#ModelAdmins
View
4 filer/settings.py
@@ -16,7 +16,9 @@ def generate_filename(instance, filename):
FILER_IS_PUBLIC_DEFAULT = getattr(settings, 'FILER_IS_PUBLIC_DEFAULT', False)
-FILER_STATICMEDIA_PREFIX = getattr(settings, 'FILER_STATICMEDIA_PREFIX', settings.MEDIA_URL + 'filer/' )
+FILER_STATICMEDIA_PREFIX = getattr(settings, 'FILER_STATICMEDIA_PREFIX', None)
+if not FILER_STATICMEDIA_PREFIX:
+ FILER_STATICMEDIA_PREFIX = (getattr(settings,'STATIC_URL', None) or settings.MEDIA_URL) + 'filer/'
FILER_PUBLICMEDIA_PREFIX = getattr(settings, 'FILER_PUBLICMEDIA_PREFIX', 'filer_public/')
FILER_PUBLICMEDIA_URL = getattr(settings, 'FILER_PUBLICMEDIA_URL', urlparse.urljoin(settings.MEDIA_URL, FILER_PUBLICMEDIA_PREFIX).replace('\\', '/') )
View
7 filer/testsettings.py
@@ -12,7 +12,10 @@
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.admin',
- 'django.contrib.sessions',]
+ 'django.contrib.sessions',
+ 'django.contrib.staticfiles']
ROOT_URLCONF = 'filer.testurls'
-MEDIA_ROOT = os.path.abspath( os.path.join(TMP_ROOT, 'media') )
+MEDIA_ROOT = os.path.abspath( os.path.join(TMP_ROOT, 'media') )
+MEDIA_URL = '/media/'
+STATIC_URL = '/static/'
Please sign in to comment.
Something went wrong with that request. Please try again.