TIL: easy-django-cli
Simplify your command management workflow in Django
This year, I decided to start these short TIL (Today I Learned) articles. Let me know if you find it interesting. 🙃
One small library that I found very useful recently is easy-django-cli. If you have managed a bunch of Django projects, you probably found it annoying to always start a command with python manage.py. Of course, you can create aliases to ease this pain, but I always prefer to use a Python solution if I can, and this last one recently came to my attention.
Installation
You can use your favorite package manager.
$ pip install easy-django-cli
# or with uv
$ uv add --dev easy-django-cliUsage
The library provides two command lines depending on your mood or restrictions (if you already have a command/alias of the same name).
Without easy-django-cli
$ python manage.py runserver
$ python manage.py makemigrationsWith easy-django-cli
$ django runserver
$ django makemigrations
# or even shorter
$ dj runserver
$ dj makemigrationsI personally prefer the shorter syntax.
This is all for this article, hope you enjoy reading it. Take care of yourself and see you soon. 😁
