On Tue, Jul 8, 2008 at 4:33 AM, allisongardner
<[EMAIL PROTECTED]> wrote:
> Will look further into problem as it does not accept any of my user
> logins that have been created by the admin site, even though I know i
> am using the correct username and password. I do have shell access as
> I am using my own computer. When I have worked out what to do I will
> look into your second suggestion. Thanks agin for quick response.
> MWAH!!!

If you're on Django 0.96 or a checkout of the development code,
there's special-case handling in the admin for creating users such
that the password will be properly set, as well as a special-case
editing view for changing passwords through the admin.

For manually creating users from Python code, the Django User model
has a manager with a special method -- create_user() -- which will
handle this for you, so doing:

    from django.contrib.auth.models import User
    u = User.objects.create_user('bob', '[EMAIL PROTECTED]', 'some_password')

will work.

For manually editing users from Python code, the User model defines a
method called 'set_password()' which also handles this for you:

    from django.contrib.auth.models import User
    u = User.objects.get(username='bob')
    u.set_password('some_new_password')
    u.save()

For bulk imports, you can currently rely on some backwards-compatible
hackery we do to support storing passwords as plain old MD5 hashes, by
which Django will transparently "upgrade" the stored password to a
(more secure) salted SHA1 hash the next time the user successfully
logs in.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to