currently, self.image.name displays the absolute server path...

i want to change this so that when i call it, it either display the
relative path, or an absolute path for the website itself.

so instead of displaying /home/site/mysite/images/gallery/
imagename.jpg

it will display http://www.sitename/images/gallery/imagename.jpg

in settings i have:

MEDIA_ROOT = '/home/site/mysite/images'
MEDIA_URL = 'http://www.sitename.com/images/'

in the models.py:

image = models.ImageField(upload_to='/home/site/mysite/images/
gallery')

"mysite" being the base level directory for the site itself


--~--~---------~--~----~------------~-------~--~----~
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