Lansana Camara
Lansana Camara

Reputation: 9873

'python manage.py createsuperuser' error

The 'python manage.py createsuperuser' command gives me this error:

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

Looking through the source, namely createsuperuser.py, it catches the NotRunningInTTYException:

except NotRunningInTTYException:
    self.stdout.write(
        "Superuser creation skipped due to not running in a TTY. "
        "You can run `manage.py createsuperuser` in your project "
        "to create one manually."
    )

Anyone know how I can resolve this error? if it makes any difference, my installation process was a headache... getting 'python manage.py runserver' took me a good day. Maybe I don't have things configured properly... Using Windows.

Upvotes: 2

Views: 5420

Answers (3)

user19380298
user19380298

Reputation:

You can create super user using:

winpty python manage.py createsuperuser

Upvotes: 0

Andrey Zinovich
Andrey Zinovich

Reputation: 267

For Windows CMD console you should do this steps (if you use virtual environment):

  1. c:\Path_to_you_App\venv\Scripts\activate
  2. (venv) cd c:\Path_to_you_App
  3. (venv) c:\Path_to_you_App>python manage.py createsuperuser

Upvotes: 1

masnun
masnun

Reputation: 11916

I believe you tried to run this inside an IDE or some other environment which is not a TTY. Django expects the command to be run from a TTY compatible shell.

Run the command on your Windows command prompt, outside your editor/IDE. It should work.

To know more about TTY:

Upvotes: 4

Related Questions