Python Shell (accessing Django)

?
S
Bash

Just a simple snippet explaining how to access Django via Python Shell

1>>> from django.contrib.auth.models import User
2>>> u = User.objects.get(username__exact='xpto')
3>>> u.set_password('xpto-pass')
4>>> u.save()

Created on 4/8/2019