How to reset Django admin password?

前端 未结 21 1883
遥遥无期
遥遥无期 2020-12-12 08:39

I am using Django (version 1.3) and have forgotten both admin username and password. How to reset both?

And is it possible to make a normal user into admin, and then

21条回答
  •  余生分开走
    2020-12-12 09:41

    1. python manage.py createsuperuser will create another superuser, you will be able to log into admin and rememder your username.
    2. Yes, why not.

    To give a normal user privileges, open a shell with python manage.py shell and try:

    from django.contrib.auth.models import User
    user = User.objects.get(username='normaluser')
    user.is_superuser = True
    user.save()
    

提交回复
热议问题