from django.contrib.auth.models import User
u = User.objects.get(username='john')u.set_password('new password')u.save()
i know that i can run it in django shell (manage.py shell)
but i want to write these in a file(its some confusing that every code in views.py should return a http response but this type of commands does not return any respone)
where should i put this code ??thanks for your attention.
But when I put this code in model.py, when I run the server it returns an error about constraints failed but the user was added in Django admin users. Why this happen??
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.