title: What user should own my Python scripts and application directories?
body: <p>I've been using <code>chown www-data:www-data -R /path/to/my/django-app/</code> and simply letting my virtualenv's dirs / files be owned by <code>root</code> (since <code>sudo pip install foo</code> implies that by default). This just doesn't feel right though. Is this pretty typical, or, should <code>www-data</code> only own directories that it can upload files to? If I allow <code>root</code> to own everything, my server won't even be able to write <code>.pyc</code> files, or will it? I'm clearly quite new to Unix permissions. What is the secure, proper way to handle this?</p>