Hi Kelvin, I just ran into that problem, too. However the hint to MEDIA_URL was correct!
You must add the following to the very bottom of your urls.py: if settings.DEBUG: urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'd:sites/sgms/media'}), ) This is described here: http://docs.djangoproject.com/en/dev/howto/static-files/ Greetz, M On 20 Sep., 16:07, "kelvin pompey" <[EMAIL PROTECTED]> wrote: > ok I've set the MEDIA_URL and MEDIA_ROOT, but when I click the link I get > the 404 file not found error message. If i set ADMIN_MEDIA_PREFIX to a blank > string then I can access the link. But there is a problem, when I try to > change the image through the form I get a page does not exist error > message. > My current settings are > > MEDIA_ROOT = 'd:sites/sgms/media/' > MEDIA_URL = 'http://localhost:8000/media/' > ADMIN_MEDIA_PREFIX = '/media/' > > and the model > > class Student(models.Model): > photo = models.ImageField(upload_to='photos') > > I am using the automatic admin site. > > On Sat, Sep 20, 2008 at 7:22 AM, Srik <[EMAIL PROTECTED]> wrote: > > > Make sure you have MEDIA_URL set :) > > > Run into similar error, setting MEDIA_URL resolved it :) > > > On Sep 18, 1:17 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote: > > > I am using an imagefield from the admin interface. I can upload images > > > without problems but when I click the link to view the image, I get > > > the following error. > > > > invalid literal for int() with base 10: '1/photos/desktop.png' > > > > Any idea what's wrong? I am using django 1.0. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---