I am setting up a Django project in production. But I'm dealing with a weird permission issue. Before all, this is the structure of my project:
project
project
- settings.py
- urls.py
- wsgi.py
- ...
- apps
- app1
- app2
- app3
logs
- static
- ...
When deploying it, the site won't run unless www-data is user owner or group owner of project/project/apps (recursive) wether it's 775 or 550 permission. It has an HTTP 500 error
Weirdly, when I change permission to 777, and remove all ownership from www-data, I still have the same HTTP 500 error.
The usual error is an ImportError. It cannot import some modules/apps.
Now my question is why is that? At least with permission 777, it should run as www-data would anyway have full permissions on the folder project/project/apps
It looks as if Apache (www-data) just want to own the folder (whether it's at group level or user level)
How do you set permissions on django project folders when you deploy with Apache?