Storing News in a Database

In this tutorial, we’ll take a tour of Anvil and build a simple news aggregator. We’ll start from a blank page, and build up to a web app complete with database storage and deployed on the web - all in nothing but Python.

This is also known as a CRUD app, named after the Create, Read, Update and Delete operations.

The final app will look something like this:

screenshot of the completed app

The techniques you’ll learn in this tutorial are fundamental to building any Anvil app, and mastering them will give you a good understanding of how Anvil works.

You don't need any prior experience with Anvil or web development to complete this tutorial.

All you'll need is a little bit of Python. If you’re new to Python, here are some resources to help you get started.


In this tutorial, you'll:

Build your user interface

Build a User Interface (UI) to add and edit the articles.

Write client-side Python

Write some client-side Python code to populate the ‘categories’ dropdown from the database.

Add news articles to the database

Create: Save the article information that the user enters.

Update existing articles

Update: Modify existing articles using your app.

Optional: Customise font

Modify the theme of your app to use a custom font.

Click the following link to clone the finished app and explore it yourself, or read on as we take a step-by-step guide to building it yourself.

If you prefer a more theoretical approach to learning, you can dive straight into the documentation.