如何在uWSGI上运行OpenERP?
我在网上找到了这个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我在/var/www/ OpenERP /venv中的虚拟环境中安装了openerp,可以通过调用$ openerp-server来运行它。
提前谢谢。
发布于 2013-01-20 19:31:36
您可以将脚本文件放在与openerp-server.py文件相同的目录中。
然而,当我测试它时,它不工作,因为gunicorn在导入的openerp语句中找不到openerp。原因是openerp没有作为python模块安装到系统周围的安装程序中。
我认为当您使用DEB包进行openerp安装时,它会起作用。(当你进行这样的安装时,你应该禁用启动脚本,这样它就可以在gunicorn下工作。
让我也做一个测试安装,并分享结果。
https://stackoverflow.com/questions/11913027
复制相似问题