0

Hi all i just set up nginx with my django project and want to set permission for the files and directries here is the permission i set and it dose not work what is the right one and what is best practice in django when it comes to file permission? also can I set it from nginx or just command line thanks

sudo find /home/my_home_dir/this_django_project/ -type f -print0 | xargs -0 chmod 0644
sudo find /home/my_home_dir/this_django_project/ -type d -print0 | xargs -0 chmod 0755
sudo chmod 700 /home/my_home_dir/this_django_project/./manage.py /home/my_home_dir/this_django_project/this_django_project/settings.py

1 Answer 1

0

Best Practice:

  1. Make sure none of your code is readable by nginx.
  2. Make sure none of your static/media is writable by nginx.
  3. Make sure media directory is writable by uwsgi/gunicorn.
1
  • Make sure it is writable by the same user that you run gunicorn with.
    – Thomas
    Nov 12, 2014 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.