Isn't it just putting variable into template? I don't know if I
understand you correctly but for example:
models.py
Image(models.Model)
name = CharField(...)
location = ImageField(...)
YourModel(models.Model)
image = ForeignKey(Image)
user = ForeignKey(User)
(...)
index.html:
<img src="/media/{{ my_model.image.location }}"
alt="{{
my_model.image.name }}" />
views.py:
(...)
from django.template import RequestContext
def my_request_context():
my_model = MyModel.objects.get(user=request.user)
# you can get the Image : my_model.image
return my_model # or my_model.image
and then use it when you need (rememer to add it to
TEMPLATE_CONTEXT_PROCESSORS in settings, and to call the request
context everytime you need it in views in 'render_to_response')
But I don'f now if it is what you need.
You should focus on
http://www.djangoproject.com/documentation/templates_python/
(everything is written there)