Looked at some other similar answers on stack overflow, but no relevant answer was found.
STATIC_ROOT = /home/www/proj_a/static
MEDIA_ROOT = /home/www/proj_a/media
STATIC_URL = /static/
MEDIA_URL = /media/
in some class in some model, we have the upload_to set
pix = models.FileField(_('photo'), upload_to='upload', blank=True)
I would have expected the file to be sent to /media/upload/1.jpg
However, it ends up in /static/upload/1.jpg
This is not lining up with my understanding of docs on Django 1.3.
I am using Django 1.3 in Debug mode.
I am not using Apache yet, I’ll worry about it later, for now I am just trying to figure out the runserver issue in debug mode.
Thx
You can set a custom storage directory by doing something like this:
UPLOAD_ROOT is defined in my settings.py file: /path/www/upload
Check these 2 pages for more details:
http://abing.gotdns.com/posts/2009/django-file-upload-handling-examples/
http://docs.djangoproject.com/en/dev/howto/custom-file-storage/