django-userena: User Management Application for Django.


What is django-userena?

django-userena is a Django application that supplies your Django project with full account management. It’s a fully customizable application that takes care of the signup, activation, messaging and more.

How to install django-userena?
You can install the latest version of django-userena using:
pip install django-userena

Source Code:
https://github.com/bread-and-pepper/django-userena

How to setup django-userena?
Add AUTHETICATION_BACKEND tuple as given below:

AUTHENTICATION_BACKENDS = (
    'userena.backends.UserenaAuthenticationBackend',
    'guardian.backends.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
)

Add userena, gaurdian and easy_thumbnails to your INSTALLED_APPS settings of your project.

The URI’s
Userena has a URLConf that sets all the url’s and views for you. This should be included in your project’s URLConf. For example, if you wants the urls to show up under ‘/accounts/’, add the following under urlpattern in you URLConf.

(r'^accounts/', include('userena.urls')),

Required Settings
1. Django-guardian requires you to set the ANONYMOUS_USER_ID setting.

ANONYMOUS_USER_ID = -1

2. Set AUTH_PROFILE_MODULE point to the model that is your custom made profile.For example: set AUTH_PROFILE_MODULE to the path of MyProfile

from userena.models import UserenaBaseProfile

class MyProfile(UserenaBaseProfile):
    user = models.OneToOneField(User,
                                unique=True,
                                verbose_name=_('user'),
                                related_name='my_profile')
    favourite_snack = models.CharField(_('favourite snack'),
                                       max_length=5)

3. To integrate with Django, you need to alter three settings to reflect in you URI.
For example, if your userena lives under ‘/accounts/’

LOGIN_REDIRECT_URL = '/accounts/%(username)s/'
LOGIN_URL = '/accounts/signin/'
LOGOUT_URL = '/accounts/signout/'

References:django-userena documentation

Advertisements
4 comments
  1. Looks interesting, is there a website currently using this app? Its use was not quite apparent on BreadandPepper

      • Not the implementation, but its use in a website

      • django-userena is an User account management app that helps in the creating/updating user settings in your django website. On integrating it with the project, its provides with the signin/signup/logout, activation features, basic user profile model and other needful settings.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: