from content.models import Document, Folder
from django.http import Http404, HttpResponse
from django.template import RequestContext, loader
-from settings import MEDIA_URL
def document_view(request, slug=None, folders=None):
if folders == None and slug == None:
{
"content" : doc.content,
"title" : doc.title,
- "media_url" : MEDIA_URL,
})
return HttpResponse(t.render(c))
--- /dev/null
+from django.conf import settings
+
+def media(request):
+ return {
+ 'MEDIA_URL': settings.MEDIA_URL,
+ }
'content',
'generic',
)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+ 'django.core.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.core.context_processors.i18n',
+ 'generic.context_processors.media'
+)
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>{% block title %}{{ title }}{% endblock %}</title>
- <link rel="stylesheet" type="text/css" href="{{ media_url }}style/main.css" />
+ <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}style/main.css" />
</head>
<body>
<div id="page">