Giter Club home page Giter Club logo

django-registration-invitationcode-backend's Introduction

Invitation code backend for django-registration

This is custom backend for django-registration.

Features of backend:

  • requires invitation code to proceed,
  • requires TOS (Terms of Service) accepted by user.

Invitation codes are useful for e.g. service beta testing. Also, since backend is fully compatibile with default backend, when your service is going public and you decide not to use invitation codes, all you need to do is turn "default" backend on.

Installation

  1. Copy invitation directory contents to your django-registration backends - such as registration/backends/invitation/

  2. In settings.py INSTALLED_APPS section add 'registration.backends.invitation' after 'registration':

    INSTALLED_APPS = (
        'registration',
        'registration.backends.invitation',
    )
    
  3. You must change your urls.py where you are invoking registration (check project main urls.py):

    (r'^accounts/', include('registration.backends.invitation.urls'), ),
    
  4. Run syncdb or south schemamigration if you use it:

    ./manage.py syncdb
    

Invitation code

Application created InvitationCode model for codes. Invitation codes can be anything you want - here there are 5 random characters.

InvitationCode model also stores information about who and when used specific code so you can track it.

Sample invitation code generation

You can make invitation code as long as you want (change max_length in InvitationCode model if you want it to be longer than 5).

Sample code for generation:

import string
import random

def generate_random_string():
    chars = string.letters + string.digits
    return "".join(random.sample(chars, 5))

Locale

Application provides translation for languages:

  • Polish (pl)

To create new translation simply run:

django-admin.py makemessages -l <language_code>

Requirements

django-registration-invitationcode-backend's People

Contributors

grzegorzbialy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.