Now we’ll call the get_items function from Anvil and display the result in the Data Grid.

First, run your inventory.py script. It will initialise and wait for connections from your app:

$ python3 inventory.py
Connecting to wss://anvil.works/uplink
Anvil websocket open
Authenticated OK

In your Anvil app, go to the Code View of Form1.

At the end of the __init__ method, add this line:

    self.repeating_panel_1.items = anvil.server.call('get_items')

Now run your app. The data from your external Postgres database will be displayed in the table!

That’s every element of the system in place!

We’ve implemented the whole system: the database, Uplink script, and web app.

We’ve implemented the whole system: the database, Uplink script, and web app.