Skip to content
Browse files

Adjust media to use static + media for packaging purposes

  • Loading branch information...
1 parent b1e0fa3 commit 2a908ffacc35753ca38f1539bc7e024a4d2a5295 @dcramer committed Jul 29, 2010
View
2 pastethat/settings.py
@@ -33,8 +33,10 @@
USE_I18N = True
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
+STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
MEDIA_URL = '%s/media/' % (BASE_URL,)
+STATIC_URL = '%s/media/' % (BASE_URL,)
ADMIN_MEDIA_PREFIX = '%s/admin/media/' % (BASE_URL,)
View
0 pastethat/media/images/children.png → pastethat/static/images/children.png
File renamed without changes
View
0 pastethat/media/images/delicious.gif → pastethat/static/images/delicious.gif
File renamed without changes
View
0 pastethat/media/images/digg.gif → pastethat/static/images/digg.gif
File renamed without changes
View
0 pastethat/media/images/down.png → pastethat/static/images/down.png
File renamed without changes
View
0 pastethat/media/images/download.png → pastethat/static/images/download.png
File renamed without changes
View
0 pastethat/media/images/edit.png → pastethat/static/images/edit.png
File renamed without changes
View
0 pastethat/media/images/followup.png → pastethat/static/images/followup.png
File renamed without changes
View
0 pastethat/media/images/furl.gif → pastethat/static/images/furl.gif
File renamed without changes
View
0 pastethat/media/images/google.gif → pastethat/static/images/google.gif
File renamed without changes
View
0 pastethat/media/images/logo.png → pastethat/static/images/logo.png
File renamed without changes
View
0 pastethat/media/images/new.png → pastethat/static/images/new.png
File renamed without changes
View
0 pastethat/media/images/reddit.gif → pastethat/static/images/reddit.gif
File renamed without changes
View
0 pastethat/media/images/share.png → pastethat/static/images/share.png
File renamed without changes
View
0 pastethat/media/images/stumbleupon.gif → pastethat/static/images/stumbleupon.gif
File renamed without changes
View
0 pastethat/media/images/twitter.gif → pastethat/static/images/twitter.gif
File renamed without changes
View
0 pastethat/media/images/view.png → pastethat/static/images/view.png
File renamed without changes
View
0 pastethat/media/images/yahoo.gif → pastethat/static/images/yahoo.gif
File renamed without changes
View
0 pastethat/media/styles/global.css → pastethat/static/styles/global.css
File renamed without changes.
View
6 pastethat/utils/template/defaultfilters.py
@@ -49,14 +49,14 @@ def timesince(value):
def mediaversion(value):
"""Returns the modified time (as a string) for the media"""
try:
- fname = os.path.abspath(os.path.join(settings.MEDIA_ROOT, value))
+ fname = os.path.abspath(os.path.join(settings.STATIC_ROOT, value))
if not fname.startswith(settings.PROJECT_ROOT):
- raise ValueError("Media must be located within MEDIA_ROOT.")
+ raise ValueError("Media must be located within STATIC_ROOT.")
return unicode(int(os.stat(fname).st_mtime))
except OSError:
return 0
register.object(mediaversion)
def mediaurl(value, arg=None):
- return "%s%s?%s" % (settings.MEDIA_URL, value, mediaversion(value))
+ return "%s%s?%s" % (settings.STATIC_URL, value, mediaversion(value))
register.object(mediaurl)

0 comments on commit 2a908ff

Please sign in to comment.
Something went wrong with that request. Please try again.