Skip to content

Instantly share code, notes, and snippets.

@vandorjw
Last active January 1, 2016 19:29
Show Gist options
  • Save vandorjw/8190988 to your computer and use it in GitHub Desktop.
Save vandorjw/8190988 to your computer and use it in GitHub Desktop.
sudo yum install uwsgi uwsgi-plugins-python3
uwsgi.ini
[uwsgi]
#variables
projectname = vandorjw
base = /var/sites/me/vandorjw
#config
plugins = python3
http = 127.0.0.1:9000
chdir = %(base)/src/%(projectname)
pythonpath = %(base)/src/%(projectname)
virtualenv = %(base)/venv/%(projectname)
env = DJANGO_SETTINGS_MODULE=%(projectname).settings
module = django.core.handlers.wsgi:WSGIHandler()
processes = 4
threads = 2
@vandorjw
Copy link
Author

I re-factored the settings module, similar to 2scoops-django project. If that if what you enjoy using as well, then you MUST edit the following like from

env = DJANGO_SETTINGS_MODULE=%(projectname).settings

to one of these...

env = DJANGO_SETTINGS_MODULE=%(projectname).settings.local
env = DJANGO_SETTINGS_MODULE=%(projectname).settings.production
env = DJANGO_SETTINGS_MODULE=%(projectname).settings.test

etc

@vandorjw
Copy link
Author

[uwsgi]

variables

projectname = notes_vandorjw_me
base = /var/sites/me/vandorjw/notes
plugins = python3
chdir = %(base)/src/%(projectname)
pythonpath = %(base)/src/%(projectname)
virtualenv = %(base)/venv/%(projectname)
env = DJANGO_SETTINGS_MODULE=%(projectname).settings.local
module = django.core.handlers.wsgi:WSGIHandler()
socket = /run/uwsgi/%n.socket
chmod-socket = 660
logto = %(base)/logs/uwsgi.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment