Skip to content

Instantly share code, notes, and snippets.

@andrewp-as-is
Last active October 13, 2021 19:12
Show Gist options
  • Save andrewp-as-is/f62e8d087a56a4ddf2f980c6c5b212f4 to your computer and use it in GitHub Desktop.
Save andrewp-as-is/f62e8d087a56a4ddf2f980c6c5b212f4 to your computer and use it in GitHub Desktop.
Django set_password #django
from django.contrib.auth.models import User
try:
user = User.objects.get(username="username")
user.set_password('password')
user.save()
except DoesNotExist:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment