I am attempting to deploy a Django site that has the ability to upload a file and then modify that file. It works 100% on the dev server, however after deploying it with Apache I am running into problems. The Server Error (500) happens on the indicated line in my views.py. What am I doing wrong? My problem is probably not understanding the save() method, however I could not find any info/documentation that helped me.
if request.method == "POST":
formU = FileUploadForm(request.POST, request.FILES)
f = request.FILES['myFile']
fs = FileSystemStorage()
fs.save(str(f), f) # where error occurs
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
MEDIA_URL = '/media/'
Alias /media /home/4rsenal/f_proj/media
Require all granted
If it was working on the dev server, it's probably not a Python error. I think you have a bad configuration of your virtualhost in proj.conf. Or you just forget to open rights on your folders ?