Unable to create superuser in django due to not working in TTY

19,610

Solution 1

When using the Git Bash and to correct the above error message try to append winpty
i.e. for example:

$ winpty python manage.py createsuperuser
Username (leave blank to use '...'):

Solution 2

if you are in virtualenv, cd into your virtualenv and activate it. then try these steps:

python manage.py syncdb --noinput
python manage.py migrate
python manage.py createsuperuser

Solution 3

You can create a superuser using django shell (python manage.py shell)

from django.contrib.auth.models import User
User.objects.create_superuser(username='YourUsername', password='hunter2', email='[email protected]')

Solution 4

I am a Windows10 user. I tried to run py manage.py createsuperuser command using Git Bash console, but error has been thrown. Then I switched Git Bash to native Windows Command Line with administrator privileges, and re-run command - it was working.

Solution 5

Use "Windows PowerShell" or "Windows Cmd" and then use same command. Git command interface has some restriction.

Share:
19,610
PJM
Author by

PJM

Updated on July 21, 2022

Comments

  • PJM
    PJM almost 2 years

    I go through first django tutorial from djangoproject.com and at the very beginning of part 2, which is creating superuser when I run "python manage.py createsuperuser" I get the following message back:

    Superuser creation skipped due to not running in a TTY. You can run `manage.py createsuperuser` in your project to create one manually.    
    

    I get the same message when I go on to create superuser after running syncdb.

    I am working on Eclipse for Windows 7, and Django 1.7.1 together with Python 2.7.8.