Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc for nginx and uwsgi #180

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,63 @@ Your server can then be run by the simple command:
honcho start

On Windows, the ``--beat`` option may not be supported.

Production installation of Wooey utilizing NGINX and uWSGI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change this to Through NGINX and uWSGI to be in sync with the rest of this page. This also doesn't cover production things like turning on SSL/using a separate database so it's not accurate to claim it.

----------------------------------------------------------

1. add a domain name to ALLOWED_HOSTS in django_settings.py in the settings dir of your project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually settable in user_settings.py

2. specify a static dir you like in STATIC_ROOT- default is OK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add that this is found under user_settings.py?

3. make sure the entire directory tree is chmodded and chgrouped appropriately for the webserver user..sqlite db needs to be writable by them, etc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you specify if the user is using sqlite.db -- sqlite is not a good thing for a web server to be running off so I'd rather not encourage it.

4. add these config blocks to nginx, or use these as your files if only thing hosted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you nest the config blocks under each respective part?

5. add the further down uwsgi ini wherever uwsgi will pick it up on restart

(initial configuration of uwsgi and nginx is beyond the scope of this tutorial)


sample nginx config
-------------------

```
server {
listen 80;
server_name <YOUR_DOMAIN>;
root /PATH/TO/MANAGE.PY;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ { #get dat NGINX to serve the easy stuff, have a rest uWSGI
root /PATH/TO/WHEREVER/YOU/PUT/STATIC;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/PATH/TO/[socket_name from uwsgi conf];
uwsgi_read_timeout 300;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra bracket

```

sample uwsgi config
-------------------

```
[uwsgi]
# variables
plugin = </path/to/your/built/uwsgi/python/plugin> #may just need to say "python", depending how you've installed uwsgi
projectname = <YOURPROJECT>
base = </PATH/TO/ONE/DIR/ABOVE/MANAGE.PY>
chdir = %(base)/%(projectname)
module = %(projectname).wsgi:application

# config
harakiri = 240
master = true
protocol = uwsgi
env = DJANGO_SETTINGS_MODULE=%(projectname).settings
pythonpath = %(base)/src/%(projectname)
module = %(projectname).wsgi
socket = </you/pick/path/to/socket>
chmod-socket = 666
logto = </somewhere/the/webserver/can/write>
attach-daemon = python manage.py celery worker -c 1 --beat -l info
```

Finally, restart/start NGINX/uWSGI services.