Connecting to trytond to postgresql database

Hi,

I’m new in Trython and I’m trying to setup my development environment, I use pip to install to trython, and i ran ‘hg clone trytond: log’ on command line to clone the trython source code. I also postgresql installed on my machine
however, i dont know where exactly I’m supposed to run the command ‘trytond-admin -c -d --all’ , as this command is not recorgnise on command line and sql shell (psql) of postgresql.
Please advice.

Taofik.

In order to set up trytond you should not need psql.
If you wish to use postgres the server needs to be running, but for development I see that sqlite is usually preferred because of simplicity.

In order to keep things simple I would cd into the tryton-env directory.

If you wish to run from source you should first create an venv:
Ex.:
python -m venv .venv

You should then activate your venv:
. .venv/bin/activate

Now you should install the necessary components in editable mode (dev mode, from pip install --help):

-e, --editable <path/url> Install a project in editable mode (i.e. setuptools "develop mode") from a local project

This includes dependencies, trytond:
Ex.
pip install -e trytond
Note that here you need to specify the path to the trytond package inside the tryton-env directory.

After having installed trytond you should be able to execute trytond-admin.

Do note that you need to specify the database in order to initiate it. If you specify -c you need to specify the conf file.
Otherwise you can use environment variables. They are documented on docs.tryton.org.

1 Like

I always have my development environment the same as a production environment for easy maintenance. First do the changes on the development environment then move the working changes to production.

To help setup Tryton from a clean system you can follow https://nextcloud.rollentausch.eu/index.php/s/SKZfnCFP4YKYZJE