Fix WSGI custom addons path
[odoo/odoo.git] / doc / 01_getting_started.rst
1 ========================================
2 Getting started with OpenERP development
3 ========================================
4
5 .. toctree::
6    :maxdepth: 1
7
8 Installation from sources
9 ==========================
10
11 .. _getting_started_installation_source-link:
12
13 Source code is hosted on Launchpad_. In order to get the sources, you
14 will need Bazaar_ to pull the source from Launchpad. Bazaar is a
15 version control system that helps you track project history over time
16 and collaborate efficiently. You may have to create an account on
17 Launchpad to be able to collaborate on OpenERP development. Please
18 refer to the Launchpad and Bazaar documentation to install and setup
19 your development environment.
20
21 The running example of this section is based on an Ubuntu
22 environment. You may have to adapt the steps according to your
23 system. Once your working environment is ready, prepare a working
24 directory that will contain the sources.  For a ``source`` base
25 directory, type::
26
27   mkdir source;cd source
28
29 OpenERP provides a setup script that automatizes the tasks of creating
30 a shared repository and getting the source code. Get the setup script
31 of OpenERP by typing::
32
33   bzr cat -d lp:~openerp-dev/openerp-tools/trunk setup.sh | sh
34
35 This will create the following two files in your ``source`` directory::
36
37   -rw-rw-r--  1 openerp openerp 5465 2012-04-17 11:05 Makefile
38   -rw-rw-r--  1 openerp openerp 2902 2012-04-17 11:05 Makefile_helper.py
39
40 If you want some help about the available options, please type::
41
42   make help
43
44 Next step is to initialize the shared repository and download the
45 sources. Get the current trunk version of OpenERP by typing::
46
47   make init-trunk
48
49 This will create the following structure inside your ``source``
50 directory, and fetch the latest source code from ``trunk``::
51
52   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 addons
53   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 misc
54   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 server
55   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 web
56
57 Some dependencies are necessary to use OpenERP. Depending on your
58 environment, you might have to install the following packages::
59
60   sudo apt-get install graphviz ghostscript postgresql-client \
61             python-dateutil python-feedparser python-gdata \
62             python-ldap python-libxslt1 python-lxml python-mako \
63             python-openid python-psycopg2 python-pybabel python-pychart \
64             python-pydot python-pyparsing python-reportlab python-simplejson \
65             python-tz python-vatnumber python-vobject python-webdav \
66             python-werkzeug python-xlwt python-yaml python-imaging \
67             python-matplotlib
68
69 Next step is to initialize the database. This will create a new openerp role::
70
71   make db-setup
72
73 Finally, launch the OpenERP server::
74
75   make server
76
77 Testing your installation can be done on http://localhost:8069/. You
78 should see the OpenERP main login page.
79
80 .. _Launchpad: https://launchpad.net/
81 .. _Bazaar: http://bazaar.canonical.com/en/
82
83 Command line options
84 ====================
85
86 .. program:: openerp-server
87
88 Using the command ::
89
90   ./openerp-server --help
91
92 General Options
93 +++++++++++++++
94
95 ::
96
97   --version                           show program version number and exit
98   -h, --help                          show this help message and exit
99   -c CONFIG, --config=CONFIG          specify alternate config file
100   -s, --save                          save configuration to ~/.terp_serverrc
101   -v, --verbose                       enable debugging
102   --pidfile=PIDFILE                   file where the server pid will be stored
103   --logfile=LOGFILE                   file where the server log will be stored
104   -n INTERFACE, --interface=INTERFACE specify the TCP IP address
105   -p PORT, --port=PORT                specify the TCP port
106   --net_interface=NETINTERFACE        specify the TCP IP address for netrpc
107   --net_port=NETPORT                  specify the TCP port for netrpc
108   --no-netrpc                         disable netrpc
109   --no-xmlrpc                         disable xmlrpc
110   -i INIT, --init=INIT                init a module (use "all" for all modules)
111   --without-demo=WITHOUT_DEMO         load demo data for a module (use "all" for all modules)
112   -u UPDATE, --update=UPDATE          update a module (use "all" for all modules)
113   --stop-after-init                   stop the server after it initializes
114   --debug                             enable debug mode
115   -S, --secure                        launch server over https instead of http
116   --smtp=SMTP_SERVER                  specify the SMTP server for sending mail
117  
118 Database related options
119 ++++++++++++++++++++++++
120
121 ::
122
123   -d DB_NAME, --database=DB_NAME
124                         specify the database name
125   -r DB_USER, --db_user=DB_USER
126                         specify the database user name
127   -w DB_PASSWORD, --db_password=DB_PASSWORD
128                         specify the database password
129   --pg_path=PG_PATH   specify the pg executable path
130   --db_host=DB_HOST   specify the database host
131   --db_port=DB_PORT   specify the database port
132  
133 Internationalization options
134 ++++++++++++++++++++++++++++
135
136 Use these options to translate OpenERP to another language.See i18n
137 section of the user manual. Option '-l' is mandatory.::
138  
139   -l LANGUAGE, --language=LANGUAGE
140                        specify the language of the translation file. Use it
141                        with --i18n-export and --i18n-import
142   --i18n-export=TRANSLATE_OUT
143                        export all sentences to be translated to a CSV file
144                        and exit
145   --i18n-import=TRANSLATE_IN
146                        import a CSV file with translations and exit
147   --modules=TRANSLATE_MODULES
148                        specify modules to export. Use in combination with
149                        --i18n-export
150
151 Options from previous versions
152 ++++++++++++++++++++++++++++++
153
154 Some options were removed in OpenERP version 6. For example,
155 ``price_accuracy`` is now configured through the
156 :ref:`decimal_accuracy` screen.
157
158 Configuration
159 ==============
160
161 .. _getting_started_configuration-link:
162
163 Two configuration files are available:
164
165     * one for the client: ``~/.openerprc``
166     * one for the server: ``~/.openerp_serverrc``
167
168 If they are not found, the server and the client will start with a
169 default configuration. Those files follow the convention used by
170 python's ConfigParser module. Please note that lines beginning with
171 "#" or ";" are comments. The client configuration file is
172 automatically generated upon the first start. The sezrver
173 configuration file can automatically be created using the command ::
174
175   ./openerp-server -s or ./openerp-server --save
176
177 You can specify alternate configuration files with ::
178
179   -c CONFIG, --config=CONFIG specify alternate config file
180
181 Configure addons locations
182 ++++++++++++++++++++++++++
183
184 By default, the only directory of addons known by the server is
185 server/bin/addons. It is possible to add new addons by
186
187  - copying them in server/bin/addons, or creating a symbolic link to
188    each of them in this directory, or
189  - specifying another directory containing addons to the server. The
190    later can be accomplished either by running the server with the
191    ``--addons-path=`` option, or by configuring this option in the
192    openerp_serverrc file, automatically generated under Linux in your
193    home directory by the server when executed with the ``--save``
194    option. You can provide several addons to the ``addons_path`` =
195    option, separating them using commas.
196
197 Start-up script
198 ===============
199
200 .. versionadded:: 6.1
201
202 To run the OpenERP server, the conventional approach is to use the
203 `openerp-server` script.  It loads the :ref:`openerp library`, sets a
204 few configuration variables corresponding to command-line arguments,
205 and starts to listen to incoming connections from clients.
206
207 Depending on your deployment needs, you can write such a start-up script very
208 easily. We also recommend you take a look at an alternative tool called
209 `openerp-command` that can, among other things, launch the server.
210
211 Yet another alternative is to use a WSGI-compatible HTTP server and let it call
212 into one of the WSGI entry points of the server.
213
214