Tryton development- local host

Hello Tryton experts,

I’m trying to install a development environment, and seem to have trytond running, but cannot connect to trytond from either the (windows) Tryton desktop client, or a local web browser (I am not using sao, so I am expecting only that the browser shows a Method not Supported error to at least shows the server exists).

Can anyone suggest what the problem might be and give me any guidance to resolve?

I am using WSL2 on Win10, and first installed the Docker image into WSL2 and was able to log in to Tryton using a web browser.

Here are the steps that I’ve taken so far:

Create a virtual environment and clone Tryton:

mehdi@DESKTOP-ABL2AAV:~$ mkdir tryton-dev
mehdi@DESKTOP-ABL2AAV:~$ cd tryton-dev
mehdi@DESKTOP-ABL2AAV:~/tryton-dev$ python3 -m venv .
mehdi@DESKTOP-ABL2AAV:~/tryton-dev$ source bin/activate
(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev$ hg clone tryton-env: log

Update.hg/hgrc file to add hooks (as per tryton-env/README), and generate requirements files.

(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ vi .hg/hgrc
(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ hg update
(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ ls
README modules proteus readthedocs requirements-dev.txt requirements.txt sao tryton trytond trytond-gis

Install dependencies using both requirements.txt and requirements-dev.txt (I understand I may not need requirements-dev.txt dependencies, but installed them anyway).

(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ pip install -r requirements.txt
(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ pip install -r requirements-dev.txt

(there were no errors produced in either pip install).

Execute trytond, which appears to start.

(tryton-dev) mehdi@DESKTOP-ABL2AAV:~/tryton-dev/tryton-env$ trytond/bin/trytond
28281 140476494090880 [2021-10-28 16:16:34,267] INFO werkzeug * Running on http://localhost:8000/ (Press CTRL+C to quit)

But when I attempt to connect open the local host on my machine, the page can’t load:

Thank you,
Mehdi

Try to see if you are connecting to the same address family as the server is running.
I am referring to ipv4 or ipv6. You could try to start the server listening to 127.0.0.1 and connect to 127.0.0.1 from the browser.

@Taofik might have some experience with connectivity between inside/outside wsl/wsl2.

Hi there,

You have to install and build Sao, which is the light web client that can be used to connect to the server.

Alternatively, you can pip install “tryton”, which is the GTK client.

Hello,

Thank you all for your suggestion. I found the solution and I think it’s good to share with the community if anyone is using WSL2.
The problem was Hyper-V setting on windows which was turned off when I tried to install Virtualbox earlier. I set it on using the following command and I can see “Method not allowed” on the localhost which shows Tryton is communicating with the server.
command to turn on Hyper-V:
bcdedit /set hypervisorlaunchtype auto

Cheers,

Mehdi