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 02, 2022 - 09:32
Updated: 4 years ago
0 897
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 Like 3
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 1
Sad Sad 0
Angry Angry 0
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.

Comments (0)

User