On Thu, 2006-05-18 at 06:16 +0000, wegen wrote:
> thanks very much for your help, arthur.
>
> now i can get the value returned from {{ car.get_carimage_url }} as
> something like
> http://localhost:8080/media/images/cars/car1.png.
>
> however, if i try to view the image in my template by using the
> following tag,
> <img src = '{{ car.get_carimage_url }}'>, all i get is nothing.
>
> now, i have a correct link to the image and i don't see anything wrong
> with the img tag i'm using as above.
>
> does anyone have a clue? feel free to correct me if i'm wrong.
Assuming you are using the development server, I've been bitten by this
before. The development server (./manage.py runserver) cannot handle
having your MEDIA_URL being a suburl of the ADMIN_MEDIA_PREFIX.
Normally, with something like mod_python + Apache, this would not be a
problem, but the way django.views.static.serve handles things, it gets
confused.
The solution is to change ADMIN_MEDIA_PREFIX in your settings.py to
something like /static/, rather than /media/, You don't need to change
anything else, just that one setting, then restart (or change MEDIA_URL
to be something like localhost:8080/something_else/...
Of course, if you are not using the dev server, we are still on square
one.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---