Skip to main content

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

Project description

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

https://img.shields.io/pypi/v/django-sitegate.svg https://img.shields.io/pypi/dm/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 https://landscape.io/github/idlesign/django-sitegate/master/landscape.svg?style=flat

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-0.12.0.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

django_sitegate-0.12.0-py2.py3-none-any.whl (55.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-sitegate-0.12.0.tar.gz
Algorithm Hash digest
SHA256 aa5631ef33cab6cf45d395509101f44925d3ccc6afa95937bd2a71cdbac3f98a
MD5 c2bd2ced52a6ab0923bd8337abc82805
BLAKE2b-256 4072ffa78c4a649f9d792aeb32065d133f116e1837f09794d6ff4f240f72937f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_sitegate-0.12.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 013293ab90a52011fef73cd0f1f2c776c604daa1cea7f82bd341e39efb821cdf
MD5 a1f441a1640cda6110c8786e999633d6
BLAKE2b-256 13e16f3b0ee59fa7f09e389daca0dd156dcce60c827c13d5b9ab2937ebb6282c

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