1. Shmigelsky Andrey
  2. django-confirmation

Wiki

Clone wiki

django-confirmation / Home

Description

Simple django application for confirmation of user actions. Typical usecase is user activation.

Features

  • Time limited confirmations.
  • Signal with request parameter on successfull confirmation. Usecase is autologin user by this signal.
  • Store arbitrary data in json field.
  • Raising 404 page on invalid confirmation.

Examples

User activation

To create confirmation, add this code to your registration view

from django.conf import settings

from confirmation.models import Confirmation


ACTIVATION_TYPE = 1

def registration(request):
    ....
    # user creation logic
    ....
    confirmation = Confirmation.objects.create(user, ACTIVATION_TYPE)
    link = confirmation.get_url(request, "/")
    # now you can send email to user with confirmation link
    ...

Requirements

  • python >= 2.4
  • django >= 1.1

Installation instructions

  • Copy confirmation directory to your django project or put in on PYTHONPATH. Also you can run sudo python setup.py install
  • add 'confirmation' to INSTALLED_APPS and run python manage.py syncdb
  • add 'confirmation.middleware.ConfirmationMiddleware' to your settings.py file

Updated