Have you considered creating a separate view for that particular
image? You'd have a view designed to grab that image and return it
with the proper MIME type. Then you could, in your Welcome method,
return a dynamically generated path to that URL using the reverse()
method, which you'd use in your <img> tag in your template.

On Apr 28, 2:54 pm, hareesh <[EMAIL PROTECTED]> wrote:
> (I'm a django n00b).
>
> Through a database, I get the raw contents of an image and the image's
> mimetype:
>
> def Welcome(request):
>   (mime, blob) = d.GetMedia()
>   ...
>   return shortcuts.render_to_response('welcome.html', { 'msg'  :
> 'Welcome!', 'logo' : blob }) # Line 3
>
> Now clearly, this (Line 3) doesn't work as I intend it to. So what is
> the best way of showing the raw image? Must I write it to my "static
> files" directory and then pass the full path of the newly written
> image, to the context dict in render_to_response?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to