Skip to content

Instantly share code, notes, and snippets.

@unbit
Created February 28, 2012 19:21
Show Gist options
  • Save unbit/1934527 to your computer and use it in GitHub Desktop.
Save unbit/1934527 to your computer and use it in GitHub Desktop.
openerp .wsgi file for uWSGI and mod_wsgi
import openerp
try:
import uwsgi
uwsgi.port_fork_hook = openerp.wsgi.core.on_starting
except:
openerp.wsgi.core.on_starting()
# Equivalent of --load command-line option
openerp.conf.server_wide_modules = ['web']
# internal TODO: use openerp.conf.xxx when available
conf = openerp.tools.config
# Path to the OpenERP Addons repository (comma-separated for
# multiple locations)
conf['addons_path'] = '/home/openerp/addons/trunk,/home/openerp/web/trunk/addons'
# Optional database config if not using local socket
#conf['db_name'] = 'mycompany'
#conf['db_host'] = 'localhost'
#conf['db_user'] = 'foo'
#conf['db_port'] = 5432
#conf['db_password'] = 'secret'
# OpenERP Log Level
# DEBUG=10, DEBUG_RPC=8, DEBUG_RPC_ANSWER=6, DEBUG_SQL=5, INFO=20,
# WARNING=30, ERROR=40, CRITICAL=50
# conf['log_level'] = 20
# If --static-http-enable is used, path for the static web directory
#conf['static_http_document_root'] = '/var/www'
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
application = openerp.wsgi.core.application
@john2x
Copy link

john2x commented Aug 13, 2012

Hi. I'm trying to use this, but I just get a "No handler found." in the browser.

@kenvac
Copy link

kenvac commented Apr 15, 2013

Even I am looking for the solution from ages.

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