views:

57

answers:

1

Hay guys, I'm using an ImageField to upload files, however when i add upload_to to the ImageField it doesnt append the directory to the MEDIA_ROOT

MEDIA_ROOT = '/Users/username/Django/site/assests/'

picture = models.ImageField(upload_to='uploads')

i get an error saying

No such file or directory: u'/Users/username/Django/site/assests/2homemap.png'

Also the record added to the DB is just the file name (without the uploads)

any ideas?

+1  A: 
  1. Make sure the MEDIA_ROOT directory exists
  2. Check your permissions, make sure the user under which the django is running can write to the target directory (MEDIA_ROOT + 'uploads')
Issue was i was using an old version of django!
dotty