how to use variables in settings.py on template. 

eg :

[settings.py]
----------------------------------------------
import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), 
"./"))
PROJECT_NAME = 'e_book'

MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media/')
MEDIA_URL = '/'


[templates\home.html]
-------------------------------------------------------------------------------------------------------------------
{% block content %}
    <div class="content">
        <div class="tc"><h1>{{ PROJECT_NAME }}</h1></div>
        <div class="tc"><img src="{{ PROJECT_ROOT 
}}images/1269206_36297494-resized.jpg" /></div>
    </div>
{% endblock %}


---------------------------------------------------------------------------------------------------------------
[all my media files are in \site_media\images   ,   \site_media\css   , 
---------------------------------------------------------------------------------------------------------------

 im not able to use the images in the folder it gives error 404

more over the variables in the settings.py files are not reflected on the 
templates


PLease help...

Thanks



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to