0

I am trying to upload an image to the server. No matter what I do, it doesn't appear to properly upload the image. Here is my field in the model:

image = models.ImageField(upload_to='uploads/images/staff', verbose_name='Staff Member Photo', help_text='Required Dimensions: Square, about 275px height/width')

Here are my settings in the settings.py file:

STATIC_URL = "/static/"

STATIC_ROOT = 'static'

MEDIA_URL = STATIC_URL + "media/"

MEDIA_ROOT = 'static/media/'

I can't figure out what's going on--it's driving me crazy!!

1 Answers1

0

You should use the absolute path in the MEDIA_ROOT property. For example:

MEDIA_ROOT = '/var/www/mysite/static/media/'

BTW, what error you get then uploading the image? Is it a path-related problem?

catavaran
  • 44,703
  • 8
  • 98
  • 85