Day 24 of the Anvil Advent Calendar

Build a web app every day until Christmas, with nothing but Python!

The gift of giving feedback

For todays advent of code, we built a quick app to help your friends and family give you feedback on your gifts:

Of course, the app is built with nothing but Python!

Here’s how it works:

For this app, we took advantage of Anvil’s RichText component. We added a few slots to the RichText and populated them with DropDowns. Each DropDown contains some suggestions for people to use in their feedback.

DropDown being added to RichText slot

DropDown being added to RichText slot.

Then, we collect all the selections a user makes with some client-side Python and pass their feedback to a server function to store the feedback in our app’s database. We also call to use Anvil’s built-in Email Service to send us an email with the feedback.

def submit_feedback(name, gift, feedback):, gift=gift, feedback=feedback)
    subject=f"Feedback for {gift}",
      From: {name}
      Gift: {gift}

Here’s how the email looks in our inbox:

The email our app sends

And that’s all there is to it!

See the Source

Check out the source code for yourself!

Give the Gift of Python

Share this post: