simonw / django-openid

A modern library for integrating OpenID with Django - incomplete, but really nearly there (promise)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

admin interface in the demo projects

yml opened this issue · comments

Adding the admin interface the demo projects would help to understand what is going on. It would also help to understand how the "monkeypatch_adminsite" is supposed to be used. Reading the source I am under the impression that this function should add the capability to login into the admin interface using openid .

admin.autodiscover()
admin_site = admin.site
monkeypatch_adminsite(admin_site)
class NoSignNext(RegistrationConsumer):
    sign_next_param = False

urlpatterns = patterns('',                 
     (r'^$', lambda r: HttpResponseRedirect('/openid/')),
     (r'^openid/(.*)', NoSignNext()),
     (r'^admin/', include(admin_site.urls)),
)

Using the code above does not change the login form to add an openid field. Could you please point me what I am missing ?

Thank you for this library full of gems.
Regards,
--yml

Regarding the monkey patch comment the solution is to create a directory templates/admin into the project and copy inside the file from django_openid/templates/django_openid/admin_login.html.

regards,
--yml