-
Notifications
You must be signed in to change notification settings - Fork 186
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
---------------------------------------------------------- | ||
|
||
1. add a domain name to ALLOWED_HOSTS in django_settings.py in the settings dir of your project | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually settable in |
||
2. specify a static dir you like in STATIC_ROOT- default is OK | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add that this is found under |
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
There was a problem hiding this comment.
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.