Hi, the problem is (like you mentioned) django has no reference to
where your images are.

A way i got around this was, adding a line to my urls.py that
contained a 'static' folder. for example:

(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': 'C:/path-to-project/templates/static/',
'show_indexes' : True}),

Now, any urls that start with /static/ get pointed to a folder on my
computer. so whenever i want an image, i place it in 'C:/project/
templates/static/images' and i can reference it from django from the
following url http://127.0.0.1:8000/static/images/image.jpg

the good thing is, this also works for css, javascript, html, & xml
files.

obviously if you move your project online that folder structure will
have to be changed to reflect your server.

hopefully that helps. I'm relatively new with django also so there
could be another/better way to do this.

Jarred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to