Commits

Tino de Bruijn  committed 8d43ec2

Added explanation about using in conjunction with django-user-creation

  • Participants
  • Parent commits 1de50c7

Comments (0)

Files changed (1)

 .. note::
 	The admin will display the username in the top right corner of the logged
 	in user if the user has no firstname. If you want to override that, over-
-	ride the ``admin/base.html`` template.
+	ride the ``admin/base.html`` template.
+	
+In conjunction with django-user-creation
+========================================
+
+If you want to use this app in conjunction with `django-user-creation`_, you
+have to create your own ``ModelAdmin`` for ``User``. You may do so by adding a
+``useradmin.py`` file to your project with the following contents::
+
+	from django.contrib import admin
+	from django.contrib.auth.models import User
+	from user_creation.forms import EmailAccountCreationForm
+	from email_login.useradmin import EmailLoginAdmin
+
+
+	class MyUserAdmin(EmailLoginAdmin):
+	    add_form = EmailAccountCreationForm
+	    add_fieldsets = (
+	        (None, {
+	            'classes': ('wide',),
+	            'fields': ('email', 'password1', 'password2', 'email_user')}
+	        ),
+	    )
+
+	admin.site.unregister(User)
+	admin.site.register(User, MyUserAdmin)
+
+and adding the line ``import useradmin`` to your ``urls.py`` **after** the
+overrides described above.
+
+.. _django-user-creation: http://bitbucket.org/tino/django-user-creation