[IMP] hack to register the wsgi handler when running embbeded in openerp-server.

bzr revid: al@openerp.com-20110909160039-6ddslilpttvhubad
This commit is contained in:
Antony Lesuisse
2011-09-09 18:00:39 +02:00
parent 99c0bdd0fb
commit df5dd1f7b7
2 changed files with 24 additions and 0 deletions
+23
View File
@@ -1,5 +1,28 @@
import common
import controllers
import common.dispatch
try:
import openerp
import os
import tempfile
print "embedded mode"
class Options(object):
pass
o = Options()
o.dbfilter = '.*'
o.session_storage = os.path.join(tempfile.gettempdir(), "oe-sessions")
o.addons_path = os.path.dirname(os.path.dirname(__file__))
o.serve_static = True
o.server_host = '127.0.0.1'
o.server_port = 8069
app = common.dispatch.Root(o)
#import openerp.wsgi
openerp.wsgi.register_wsgi_handler(app)
except ImportError:
print "standalone mode"
# TODO
# if we detect that we are imported from the openerp server register common.Root() as a wsgi entry point
+1
View File
@@ -45,4 +45,5 @@
"static/src/css/base.css",
"static/src/css/data_export.css",
],
'wsgi' : 'app',
}