0

I tried to change my admin password but I have an error while running user = User.objects.get(username='normaluser') invalid inputshell error

Rami
  • 21
  • 9
  • You'll have to import the user model from `core` app – Brian Destura Apr 12 '22 at 02:08
  • @BrianDestura If I use `from django.contrib.core.models import User` it show this error **Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'django.contrib.core'** – Rami Apr 12 '22 at 02:14
  • Did you change your user model using `AUTH_USER_MODEL`? if so, you need to use that app's user model. – Brian Destura Apr 12 '22 at 02:16
  • @BrianDestura No I don't, how can I use this command `AUTH_USER_MODEL` ? – Rami Apr 12 '22 at 02:37

1 Answers1

0

You should use

python manage.py changepassword <user_name>

Documentation

manage.py changepassword username offers a method of changing a user’s password from the command line.

crimsonpython24
  • 2,223
  • 2
  • 11
  • 27