Anže's Blog

Python, Django, and the Web

25 Aug 2023

Django-TUI: A Text User Interface for Django Commands

django-tui screenshot

I’ve just launched django-tui, a command line tool for listing and running Django commands. It is my second Textual application this month (link to first - words-tui), so I think it’s safe to say that I’m embracing the application in the terminal idea.

How does it work?

django-tui uses Trogon to render all of the UI. Trogon is a project for turning Cklick CLIs into TUI apps.

Most of the code in django-tui deals with translating Django commands that usually use argparse to a representation that Trogon understands. I believe I covered most of the different options, but there are probably still some edge cases that I’ve missed. I’ll ship regular updates to address these and add new features in the coming weeks.

If you have any ideas on how to improve django-tui please let me know ❤️

DEMO

Fin

I’ve made the tool primarily because I can never remember the commands or their arguments’ names, especially on larger Django projects with many custom commands.

It’s great to see that other people find this useful as well. The django-tui repository already has 22 stars 🤩