Skip to main content

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

Project description

LBC Python 2

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 ‘’).
  • 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 class="my_signup_block">
            {% sitegate_signup_form %}
    {% 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.

Project details

Download files

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

Files for django-sitegate, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size django_sitegate-1.2.1-py2.py3-none-any.whl (51.8 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-sitegate-1.2.1.tar.gz (41.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page