Please read this tutorial, it explains what you should do to serve files statically:
http://www.djangoproject.com/documentation/0.96/static_files/ On May 5, 7:20 pm, checco <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following settings in settings.py: > MEDIA_ROOT = 'C:/my_project/static/' > MEDIA_URL = 'http://127.0.0.1:8000/static/' > > I'd like to display some pictures which are in the folder C:/ > my_project/static/offers ("static" is the folders that holds all the > media, while "offers" holds only a specific kind). > Assuming the name of the object which has a picture to display is obj, > what shall I insert in the template? > > obj.get_picture_url returns the following > string:http://127.0.0.1:8000/static/offers/picture_name.jpg > while obj.picture returns the following one: > offers\picture_name.jpg > > None of the following lines (in the template) seems to display the > picture: > <a><img src="{{ obj.get_picture_url }}" > {{obj.picture}} </a> > <a><img src="{{ obj.picture }}" > {{obj.picture}} </a> > > What am I doing wrong? Do I need to insert anything in the urls.py? > > Any help will be appreciated. > > thanks and regards > Francesco --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---