Skip to main content

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

Project description

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

LBC Python 2
https://img.shields.io/pypi/v/django-sitegate.svg https://img.shields.io/pypi/l/django-sitegate.svg https://img.shields.io/coveralls/idlesign/django-sitegate/master.svg https://img.shields.io/travis/idlesign/django-sitegate/master.svg

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 and log in flows for you.

Sign in

  • username/e-mail + password

  • username + password

Sign up

  • username/e-mail + password

  • invitation code + username/e-mail + password

  • username + password

  • username + e-mail + password

  • username + password + password confirmation

  • username + e-mail + password + password confirmation

Quick example

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

  • Make sure TEMPLATE_CONTEXT_PROCESSORS in your settings file has django.core.context_processors.request.

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

  1. Use sitegate_view decorator to mark your view as the one handling both signups and signins:

    from django.shortcuts import render
    
    from sitegate.decorators import sitegate_view
    
    @sitegate_view  # This also prevents 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-1.2.1.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

django_sitegate-1.2.1-py2.py3-none-any.whl (51.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: django-sitegate-1.2.1.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for django-sitegate-1.2.1.tar.gz
Algorithm Hash digest
SHA256 ab8c2a33a8e3fc1e81bcb6be585b50eac88691084afbf823e064e12e0d624541
MD5 42a87de9b4f56c32ded066c87667b8d4
BLAKE2b-256 f73db26c5c0de1a6753c0aada25e71e6f7198bf53bf182f5977da5aa0fc89905

See more details on using hashes here.

File details

Details for the file django_sitegate-1.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_sitegate-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ef4e4b6f39dfc99ebedc1073985239063e972a9340978b426dee2d3815cfa7f7
MD5 469c1a7dda8d0849dd113e3cbedfd58a
BLAKE2b-256 339abb5ae64fabc5be450c5b5e3d47b00220d0280d42ffc87bdad3a9f8b5ed65

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