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.

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?






