uwsgi-docs icon indicating copy to clipboard operation
uwsgi-docs copied to clipboard

Django tutorial: add some recommendations

Open pajod opened this issue 9 years ago • 1 comments

Some stuff that wasnt immediately obvious to me and might point others into the right direction.

pajod avatar Oct 20 '15 02:10 pajod

Reading the whole documentation it does not make sense to change the socket permission if we don't introduce the options to set uid and gid. Your comment assume we want to configure nginx with the same group of uwsgi but it well may be the other way around or just use e.g. www-data. ~~So unless you want to rework all of this including more permission hints i'm inclined to close this. Please let me know.~~

UPDATE: i think we may just want to do s/664/660/ as in:

diff --git a/tutorials/Django_and_nginx.rst b/tutorials/Django_and_nginx.rst
index 0706a75..3f772a6 100644
--- a/tutorials/Django_and_nginx.rst
+++ b/tutorials/Django_and_nginx.rst
@@ -366,7 +366,7 @@ Try::

 or::

-    uwsgi --socket mysite.sock --wsgi-file test.py --chmod-socket=664 # (more sensible) 
+    uwsgi --socket mysite.sock --wsgi-file test.py --chmod-socket=660 # (more sensible) 

 You may also have to add your user to nginx's group (which is probably
 www-data), or vice-versa, so that nginx can read and write to your socket
@@ -382,7 +382,7 @@ Let's run our Django application:

 .. code-block:: bash

-    uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=664
+    uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=660

 Now uWSGI and nginx should be serving up not just a "Hello World" module, but
 your Django project.
@@ -414,7 +414,7 @@ Create a file called ```mysite_uwsgi.ini```::
     # the socket (use the full path to be safe
     socket          = /path/to/your/project/mysite.sock 
     # ... with appropriate permissions - may be needed
-    # chmod-socket    = 664
+    # chmod-socket    = 660
     # clear environment on exit
     vacuum          = true           

xrmx avatar Oct 28 '15 14:10 xrmx