سؤال

I am no linux expert of any kind. Just setting up my own server for my Django sites.

To my understanding its because the user does not have the right permissions ? If so, what user ware we talking about?

Is it that the "user" does not have permission to read that directory with the app in ?

I followed this tut: Tutorial

هل كانت مفيدة؟

المحلول

We are talking about the user that Gunicorn (your application server) is running under. To check run htop on the command line and search for the gunicorn process. Ideally it should run under it's own user (gunicorn:gunicorn) and you should make sure your application's project folder is suitably protected - most files need only be read-only (to gunicorn) but you also need gunicorn to be able to write to the media folder (in case of user uploads etc). You just need to make sure that files aren't writeable to anyone except gunicorn (i.e. 755)

fyi :

Nginx is the web server/proxy and it is configured to pass any connections that request your app (via http://myapp.com for example) onto the application server which is gunicorn. Gunicorn in turn is configured to run Django which is sitting in a nice encapsulated virtualenv.

Supervisor (mentioned in the article) is a python application for starting, stopping and managing all of the above processes and is very handy.

نصائح أخرى

I found this article to be much more simple and straight forward. http://honza.ca/2011/05/deploying-django-with-nginx-and-gunicorn . Follow that strictly and you shouldn't have a problem

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top