I recently finished deploying my website using apache2 and django. I was testing everything, including the uploading process. But, when I select a file to upload and hit 'Save', it gives me an error:
PermissionError at /admin/path/path2/add/
[Errno 13] Permission denied: '/static'
I have all the right permissions, since I wrote these commands to allow permissions:
sudo chown -R :www-data project/static
sudo chmod -R 775 project/static
sudo chown :www-data project/db.sqlite3
sudo chmod 664 project/db.sqlite3
sudo chown :www-data project/
This works, since when I do ls -l, the permissions are correct.
This is my apache2 config file (just the static folder part):
Alias /static /home/alexholst/excelsite/static
<Directory /home/alexholst/excelsite/static>
Require all granted
</Directory>
My settings.py file has this as STATIC_ROOT and STATIC_URL:
STATIC_URL = '/static/'
STATIC_ROOT = '/home/user/project/static'
I dont know if this has to do with anything, but my css does load so i dont think it should have to do with the settings.py.
Any suggestions are very much appreciated!