# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
+MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
-MEDIA_URL = ''
-
-# URL prefix for static files. Will be made available by
-# xerxes.tools.context_processors.static
-STATIC_URL_PREFIX = '/static/'
+MEDIA_URL = '/media/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
+ADMIN_MEDIA_PREFIX = '/admin/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '6-zo+-1@-342%k4%82aw#kxr4f%5w00xhwby5$&fa@+!dh@(2='
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
- # Add STATIC_URL_PREFIX to the context
- "xerxes.tools.context_processors.static",
+ "django.core.context_processors.media",
)
LOGIN_URL = "/accounts/login/"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
{# <link rel="stylesheet" type="text/css" href="http://www.evolution-events.nl/algemeen/css.php?skin=lex"/> #}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL_PREFIX }}/base/css/lex.css"/>
+<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/base/css/lex.css"/>
-<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{{ STATIC_URL_PREFIX }}/base/css/base.css{% endblock %}"/>
+<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{{ MEDIA_URL }}/base/css/base.css{% endblock %}"/>
{# <script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js"></script> #}
{# <script type="text/javascript" src="http://yui.yahooapis.com/2.5.1/build/logger/logger-debug.js"></script> #}
-<script type="text/javascript" src="{{ STATIC_URL_PREFIX }}/base/js/yahoo-dom-event.js"></script>
-<script type="text/javascript" src="{{ STATIC_URL_PREFIX }}/base/js/logger-debug.js"></script>
+<script type="text/javascript" src="{{ MEDIA_URL }}/base/js/yahoo-dom-event.js"></script>
+<script type="text/javascript" src="{{ MEDIA_URL }}/base/js/logger-debug.js"></script>
<title>Xerxes</title>
</head>
<body>
if settings.DEBUG:
urlpatterns += patterns('',
- (r'^static/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': os.path.join(settings.PROJECT_DIR, 'static')}),
+ (r'^' + settings.MEDIA_URL[1:] + '(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': settings.MEDIA_ROOT}),
)
# vim: set sts=4 sw=4 expandtab: