Updating uwsgi config and moving init_db call to support running in uwsgi