Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vernondcole committed May 16, 2014
1 parent 2346b55 commit 5f4ba55
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
29 changes: 29 additions & 0 deletions README_eHa.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### NGINX and uWSGI

follow the guidelines in https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/
and https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

alter the settings in formhub/preset/production.py to the actual location of your production MEDIA and STATIC roots
alter formhub/nginx.conf to match
sudo ln -s /opt/formhub/formhub/nginx.conf /etc/nginx/sites-enabled/

uWSGI django.ini file
sudo ln -s /opt/formhub/formhub/wsgi.ini /etc/uwsgi/vassals/

test using:
sudo uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data

create the file /etc/init/uwsgi.conf containing:
# Emperor uWSGI script

description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]

exec uwsgi --master --die-on-term --emperor /etc/uwsgi/vassals --uid www-data --gid www-data
start it using
sudo start uwsgi

install your static files into the directory from which they will be served in production
./manage.py collectstatic

8 changes: 7 additions & 1 deletion formhub/preset/ehealth_production.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# this system uses structured settings.py as defined in http://www.slideshare.net/jacobian/the-best-and-worst-of-django

from formhub.settings import *
try:
from ..settings import *
except ImportError:
import sys, django
django.utils.six.reraise(RuntimeError, *sys.exc_info()[1:]) # use RuntimeError to extend the traceback
except:
raise

DEBUG = False # this setting file will not work on "runserver" -- it needs a server for static files

Expand Down
2 changes: 1 addition & 1 deletion odk_logger/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def submission(request, username=None):
return OpenRosaResponseBadRequest(_(u"Username or ID required."))
except IsNotCrowdformError:
return OpenRosaResponseNotAllowed(
_(u"Sorry but the crowd form you submitted to is closed.")
_(u"Sorry but the form you submitted is not a crowd form.")
)
except InstanceEmptyError:
return OpenRosaResponseBadRequest(
Expand Down

0 comments on commit 5f4ba55

Please sign in to comment.