Not able to create super user with Django manage.py

前端 未结 6 1910
感情败类
感情败类 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 03:00

    I figured out how to do so. What I did was I went to VIEWS.py. Next, I imported the module os. Then I created a function called createSuperUser(request):. Then, I then created a variable called admin and set it equal to os.system("python manage.py createsuperuser"). Then after that, return admin. Finally, I restarted the Django site, then it will prompt you in the terminal.

    import os
    
    def createSuperUser(request):
        admin = os.system("python manage.py createsuperuser")
        return 
    

提交回复
热议问题