简体   繁体   中英

OpenERP on uWSGI?

How do I run OpenERP on uWSGI?

I found this wsgi script online, but I'm not sure where to place it?

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

I installed OpenERP in a virtual environment in /var/www/openerp/venv and I can run it by calling $ openerp-server .

Thanks in advance.

you can just put the script file in the same directory with the openerp-server.py file.

however when I test it it doesnot work since gunicorn cannot find the openerp in the import openerp sentence. the reason is that openerp is not installed as a python module to the system with the installation procedures around.

I think it will work when you do a openerp install with the DEB package. (when you make such install you should disable the start script so it will just work from gunicorn.

let me also make a test install and share the result.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM