Git Product home page Git Product logo

email_auth_accounts's Introduction

Accounts

A custom email auth for Django

Detailed documentation is in the "docs" directory.

Quick start

  1. Add "accounts" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'accounts',
        'bootstrapform',
    )
    
  2. Add this to your settings.py:

    AUTH_USER_MODEL = 'accounts.User'
    
    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'accounts.backends.EmailAuth',
    )
    
  1. Include the accounts URLconf in your project urls.py like this:

    url(r'^accounts/', include('accounts.urls')),
    
  2. Run python manage.py migrate to create the accounts models.

  3. user the 'login' and 'register' url names to create links from your home page

EXTRAS

Alternative Login Success URL

If you want to change the login success url change your urls.py like so:

...
from accounts.views import login
...
# add a new success url to the account login
url(r'^accounts/login/$', login, { 'success_url': 'name of view to go to when using resolve()' }, name='login'),
# import the rest of the accounts urls after so the override is
# processed first by the urls system
url(r'^accounts/', include('accounts.urls')),

Alternative Registration Form

If you want to change the Form object used to display registrations do the following:

...
from accounts.views import register
...
# add a new success url to the account login
url(r'^accounts/register/$', register, { 'register_form': MyRegisterFormClass }, name='register'),
# import the rest of the accounts urls after so the override is
# processed first by the urls system
url(r'^accounts/', include('accounts.urls')),

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.