我在heroku服务器中创建了许多测试帐户。现在它们都具有空列,因此不起作用。现在,我想删除有关现有用户/帐户的所有数据,包括超级用户,然后重新创建。我该怎么做?
lau29888440 回答:如何从heroku服务器上删除有关用户的所有数据?
You can go to your terminal,where you have executed the command 'python manage.py runserver' and execute the command - 'python manange.py shell',then your shell will start.
Then execute the command:-
step-1: from django.contrib.auth.models import User
step-2: User.objects.all().delete() # this will delete all the user from your table
step-3: exit() # exit from the shell
step-4: python manage.py createsuperuser # for creating the superuser