I've recently deployed a django app on digital ocean. Everything works perfectly fine until I try to create an object containing an image. I get an error saying Server Error (500).
Here is what I've tried to do :
server {
listen 80;
server_name ****;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/joseph/hacka;
}
location /media/ {
root /home/joseph/hacka;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
Here is my settings.py code :
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
Unfortunately, that hasn't work out.
Please help me if you know the anwer to my problem.
Update:
I have found the problem with my code: when I turn debug to True, I get an error saying
errno 13: Permission denied.
However, I don not know how to fix this.
Please help me if you can.