Ronghui Yu wrote: > How about writing a decorator? That's possible, although there is an easier way:
The best way imho is to generate a random password when you create the user, and to send them a password reset email. Which can be implemented using django.contrib.auth. That way they don't have to know the random password, and they can't login until they have set a new password. And that way there is no need to have extra fields in the models. Regards, Roland van Laar > > > pjv 写道: >> thanks again. writing that login view is what i meant by re- >> implementing the login. my terminology is probably confusing. there is >> a generic login view in django.contrib.auth.views that does what you >> are saying, only [obviously] without the custom redirect logic that i >> want. i just copied and pasted that view into my own view and modified >> the 'standard' redirect logic in it to include the test for the two >> passwords being the same. but replacing the generic view was what i >> was originally hoping to avoid in case it gets me out of sync with >> future django updates on how auth/login works. >> >> but it's probably fine, and it is currently giving me the behavior >> that i want. >> >> On Jul 18, 9:13 pm, Shawn Milochik <[email protected]> wrote: >> >>> If I understand correctly, you can do this without having to re- >>> implementing the login. You will have to make a (very simple) login >>> template, and write a login view that contains these: >>> >>> from django.contrib.auth import login >>> login(request, form.get_user()) >>> >>> Then you can handle the redirection however you like. >>> >> >> >> > > -- > Ronghui Yu <mailto:[email protected]> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

