My changes in the django-openid

Published at 05, November 2008, author art. Tags: django, openid

I am going to move from the blogspot to my own blog engine, written in django. The main blocker right now is an OpenID authentication. I am decided to use a Simon Willison's django-openid, but it is still under the heavy development.

Here is my fork of the django-openid with few bugfixes and changes.

The most sugnificant change, on my taste, is a normal URLConf generator which I wrote for consumers. It allows you do not hardcode urls for openid login, registration and so on, but use reverse matching using "reverse" function or template tag {% url %}.

Also, I rewrote all unittest, and now they use a "reverse" function and a normal django.test.Client to talk to the clients. I think, that it is better solution, than to generate a mock WSCGI request and then pass it directly to the consumer's method.

By the way, my URLConf generator can be used to generate URL patterns for any object, which exposes "do_something" methods. For each of these methods, generator creates an URL pattern "^something/" and binds it to the object's method. "do_index" is binded to the "^$" pattern, however.

Second useful change, which I made in the django-openid is a AutoRegistration consumer, which automatically creates auth.User on login by open id. It trying to figure out some information about user requesting optional SREG data from the OpenID provider.

And finally, the dessert! I add an advanced login form, which uses newforms' MultiWidget and allow user do not guess, what does the "OpenID" mean, but just choose one of the popular services, where he has an account, from the select box and input his name on this service. I belive, that this is the most right way from the usability's view point.

I am hope, that Simon Willison will accept these changes to the django-openid's trunk somewhere, but now I am going to synchronize our repositories by hand. Stay tuned and look on my branch on the github.

Comments

Subscribe on this post's comments

permalink

10, November 2008, Āudioslave ᵝ « ... » said:

just test for pavatar

permalink

12, November 2008, art said:

Thanks.

If you wish to leave comment, please, identify yourself and then come back to this page.