Skip to main content

Reusable application for Django to ease sign up & sign in processes

Project description

http://github.com/idlesign/django-sitegate

What’s that

django-sitegate is a reusable application for Django to ease sign up & sign in processes.

This application will handle most common user registration flows for you.

Quick example

Add the sitegate application to INSTALLED_APPS in your settings file (usually ‘settings.py’).

Here follows the most straightforward way possible with django-sitegate to have both sign up & sign in functionality on your page.

  1. Use signup_view and signin_view decorators to mark your view as the one handling signups and sign ins respectively:

    from django.shortcuts import render
    
    from sitegate.decorators import signup_view, signin_view, redirect_signedin
    
    @signup_view
    @signin_view
    @redirect_signedin  # We also prevent logged in users from accessing our sign in/sign up page.
    def entrance(request):
        return render(request, 'entrance.html', {'title': 'Sign in & Sign up'})

2. Then in your template load sitegate tag library and put sitegate_signup_form & sitegate_signin_form tags in place where you want a registration and sign in forms to be.

{% extends "_base.html" %}
{% load sitegate %}

{% block page_contents %}
    <div class="my_signin_block">
        {% sitegate_signin_form %}
    </div>
    <div class="my_signup_block">
        {% sitegate_signup_form %}
    </div>
{% endblock %}

You’re done. Now your site visitors have an e-mail + password form to register and username/e-mail + password form to log in.

And mind that we’ve barely made a scratch of sitegate.

Documentation

http://django-sitegate.readthedocs.org/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sitegate-0.1.0.tar.gz (17.5 kB view details)

Uploaded Source

File details

Details for the file django-sitegate-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django-sitegate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22728fa6475116d4eceef4084ccae28d8c896ac6bfb1ba8029e415a0804756bd
MD5 c39b647c05b80a879b31e95f3601ba1d
BLAKE2b-256 310bb9a087eb9f031d81b9ee0190b7146b6387ccafccf61423dc8a2cfe7ac974

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page