Do you have this code in urls.py? if settings.DEBUG: urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':'./media/'}), )
In DEBUG mode you need such a code to serve static media. 2010/2/13 holger <mikael.holgers...@gmail.com>: > I am new to django and I am trying to get an image upload to work. > > I am using the admin interface with a ImageField in the model. > > imagefilename = models.ImageField(upload_to = 'uploads/') > > My media url is > MEDIA_URL = 'http://127.0.0.1:8000/media/' > > and my media_root is > MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') > > where project_root points to the root folder for the project > > So I want the images to be uploaded to http://127.0.0.1:8000/media/uploads/ > > I can see the images being uploaded to the directory but I can´t > access the file through the url in the template. > > What am I missing? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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. > > -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.