How to properly set path to media files in Django
Posted
by sasquatch90
on Stack Overflow
See other posts from Stack Overflow
or by sasquatch90
Published on 2010-05-19T17:11:50Z
Indexed on
2010/05/19
17:30 UTC
Read the original article
Hit count: 200
django
|django-settings
Hello. I've got a new project, and currently I'm trying to set it correctly. But somehow I can't make my media files work. Here's my current setting :
MEDIA_ROOT = os.path.normpath( '/home/budzyk/rails/fandrive/site_media/' )
templates setting work on the other hand :
TEMPLATE_DIRS = (
"/home/budzyk/rails/fandrive/templates",
)
Catalog with media files is ../fandrive/site-media/ so why it's not working ? Here's my base.html template with styles imported, and firebug window when my page is loaded :
<head>
<title>{% block title %}{% endblock %}</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/style.css" />
{% block pagecss %}{% endblock %}
<script type="text/javascript" src="{{ MEDIA_URL }}jquery/jquery-1.4.2.min.js"></script>
</head>
<body>
<div id="wrapper">
© Stack Overflow or respective owner