I have two application server 10.1.xx.xx
and 10.1.xx.yy
and middle of both I have load balancer 10.5.aa.bb
and I have deployed my Django application in both the servers successfully and able to access the application too.
There is a shared folder in between both the servers where I have to upload the images so that both servers have access of all the images, but I don't have any idea, how should I do it? up-till now I just upload the images in project folder. I googled a lot I just got this blog, http://www.bogotobogo.com/python/Django/Python_Django_Image_Files_Uploading_On_Shared_Host_Example.php
but It is also not working.
I tried with following setting but it is uploading file in project directory.
settings.py
MEDIA_URL = '/home/bynry-01/www/media/'
MEDIA_ROOT='http://192.168.1.109:3333/www/media/'
model.py
class Document(models.Model):
description = models.CharField(max_length=255, blank=True)
document = models.FileField(upload_to='documents/')
uploaded_at = models.DateTimeField(auto_now_add=True)
views.py
document=Document()
document.document = request.FILES['imgfile']
document.save()