[FIX] wsgi server listen to ipv4 0.0.0.0

bzr revid: al@openerp.com-20110924151831-7nra57wpqq6oqose
This commit is contained in:
Antony Lesuisse 2011-09-24 17:18:31 +02:00
parent 7a88d9058d
commit 73cdf6159e
1 changed files with 3 additions and 6 deletions

View File

@ -305,14 +305,11 @@ def serve():
# TODO Change the xmlrpc_port option to http_port.
try:
import werkzeug.serving
httpd = werkzeug.serving.make_server('localhost',
config['xmlrpc_port'], application, threaded=True)
httpd = werkzeug.serving.make_server('0.0.0.0', config['xmlrpc_port'], application, threaded=True)
except ImportError, e:
import wsgiref.simple_server
logging.getLogger('wsgi').warn('Can not import werkzeug, '
'falling back to wsgiref.')
httpd = wsgiref.simple_server.make_server('localhost',
config['xmlrpc_port'], application)
logging.getLogger('wsgi').warn('Can not import werkzeug, ' 'falling back to wsgiref.')
httpd = wsgiref.simple_server.make_server('0.0.0.0', config['xmlrpc_port'], application)
httpd.serve_forever()