'python manage.py createsuperuser' error
Question:
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.
Answers:
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:
For Windows CMD console you should do this steps (if you use virtual environment):
- c:Path_to_you_AppvenvScriptsactivate
- (venv) cd c:Path_to_you_App
- (venv) c:Path_to_you_App>python manage.py createsuperuser
You can create super user using:
winpty python manage.py createsuperuser
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.
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:
For Windows CMD console you should do this steps (if you use virtual environment):
- c:Path_to_you_AppvenvScriptsactivate
- (venv) cd c:Path_to_you_App
- (venv) c:Path_to_you_App>python manage.py createsuperuser
You can create super user using:
winpty python manage.py createsuperuser