Superuser creation skipped due to not running in a TTY in python django

We might get into an error while creating a superuser in Django when using a Git bash in the windows system in a virtual environment.

Aug 2, 2022 - 09:32
Aug 2, 2022 - 09:48
 0  851
Superuser creation skipped due to not running in a TTY in python django
Superuser creation skipped due to not running in a TTY in python django

Problem Statement:

We might get into an error while creating a superuser in Django when using a Git bash in the windows system in a virtual environment.

python manage.py createsuperuser

Solution :

This is due to the bug stated here https://sourceforge.net/p/msys2/tickets/32/

Now for the solution, Prefixing the command "winpty" to the code can solve this problem.
winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. The package consists of a library (libwinpty) and a tool for Cygwin and MSYS for running Windows console programs in a Cygwin/MSYS pty.

winpty python manage.py createsuperuser

Now, If you are tired of using the prefix "winpty" to every command then you can add a profile alias.

alias python='winpty python.exe'

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow

Amulya Raj Budhathoki Multi-hyphenate consultant with a demonstrated history of working in the computer software industry as well as GIS field. Skilled in GIS Application- Remote Sensing-Android Development, and Python. Strong information technology professional with the hobby of reading science and historical books.