Not able to create super user with Django manage.py

前端 未结 6 1907
感情败类
感情败类 2021-01-30 02:19

Trying to create a super user for my database:

manage.py createsuperuser

Getting a sad recursive message:

Superuser creation skippe

6条回答
  •  自闭症患者
    2021-01-30 02:50

    If you run

    $ python manage.py createsuperuser
    Superuser creation skipped due to not running in a TTY. You can run manage.py createsuperuser in your project to create one manually.
    from Git Bash and face the above error message try to append winpty i.e. for example:

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

    To be able to run python commands as usual on windows as well what I normally do is appending an alias line to the ~/.profile file i.e.

     MINGW64 ~$ cat ~/.profile
     alias python='winpty python'
    

    After doing so, either source the ~/.profile file or simply restart the terminal and the initial command python manage.py createsuperuser should work as expected!

提交回复
热议问题