Footer changes
[odoo/odoo.git] / openerp-wsgi.py
1 # WSGI Handler sample configuration file.
2 #
3 # Change the appropriate settings below, in order to provide the parameters
4 # that would normally be passed in the command-line.
5 # (at least conf['addons_path'])
6 #
7 # For generic wsgi handlers a global application is defined.
8 # For uwsgi this should work:
9 #   $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py
10 #
11 # For gunicorn additional globals need to be defined in the Gunicorn section.
12 # Then the following command should run:
13 #   $ gunicorn openerp:service.wsgi_server.application -c openerp-wsgi.py
14
15 import openerp
16 from os import sep
17 from os.path import dirname, realpath
18 import inspect
19
20
21 #>>> import os
22 #>>> import inspect
23 #>>> inspect.getfile(os)
24 #'/usr/lib64/python2.7/os.pyc'
25 #>>> inspect.getfile(inspect)
26 #'/usr/lib64/python2.7/inspect.pyc'
27 #>>> os.path.dirname(inspect.getfile(inspect))
28 #'/usr/lib64/python2.7'
29
30
31 #----------------------------------------------------------
32 # Common
33 #----------------------------------------------------------
34 openerp.multi_process = True # Nah!
35
36 # Equivalent of --load command-line option
37 openerp.conf.server_wide_modules = ['web']
38 conf = openerp.tools.config
39
40 # Path to the OpenERP Addons repository (comma-separated for
41 # multiple locations)
42
43 #base_path = realpath(dirname(__file__))
44 base_path = realpath(dirname(inspect.getfile(inspect.currentframe())))
45
46 addons_path_base = sep.join((base_path, "addons"))
47
48 addons_path_include = ",".join(sep.join((base_path, "include", path)) for path in (
49     "account-analytic",
50 #    "account-closing",
51     "account-financial-reporting",
52     "account-financial-tools",
53     "account-invoicing",
54     "acsone-addons",
55     "bank-statement-reconcile",
56     "custom/8.0",
57 ))
58
59 conf["addons_path"] = ",".join((addons_path_base, addons_path_include))
60
61 # Optional database config if not using local socket
62 #conf['db_name'] = 'mycompany'
63 #conf['db_host'] = 'localhost'
64 #conf['db_user'] = 'foo'
65 #conf['db_port'] = 5432
66 #conf['db_password'] = 'secret'
67
68 #----------------------------------------------------------
69 # Generic WSGI handlers application
70 #----------------------------------------------------------
71 application = openerp.service.wsgi_server.application
72
73 openerp.service.server.load_server_wide_modules()
74
75 #----------------------------------------------------------
76 # Gunicorn
77 #----------------------------------------------------------
78 # Standard OpenERP XML-RPC port is 8069
79 #bind = '127.0.0.1:8069'
80 #pidfile = '.gunicorn.pid'
81 #workers = 4
82 #timeout = 240
83 #max_requests = 2000
84
85 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: