Skip to content

Instantly share code, notes, and snippets.

@unbit
Created February 28, 2012 19:41
Show Gist options
  • Save unbit/1934638 to your computer and use it in GitHub Desktop.
Save unbit/1934638 to your computer and use it in GitHub Desktop.
.wsgi file for openerp (second attempt)
import openerp
import uwsgi
def foobar():
print "ciao"
openerp.conf.server_wide_modules = ['web']
openerp.wsgi.core.on_starting(None)
uwsgi.post_fork_hook = foobar
# Equivalent of --load command-line option
# 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/roberto/uwsgi/openerp-6.1-1/openerp/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
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment