Metadata-Version: 2.5
Name: django-sitegate
Version: 1.5.0
Summary: Reusable application for Django to ease sign up & sign in processes
Project-URL: Homepage, https://github.com/idlesign/django-sitegate
Project-URL: Documentation, https://django-sitegate.readthedocs.io/
Author-email: Igor Starikov <idlesign@yandex.ru>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: Django,signin,signup
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: django-etc>=1.2.0
Requires-Dist: django-siteprefs>=1.1.0
Requires-Dist: requests
Description-Content-Type: text/markdown

# django-sitegate

<https://github.com/idlesign/django-sitegate>

[![release](https://img.shields.io/pypi/v/django-sitegate.svg)](https://pypi.python.org/pypi/django-sitegate)
[![lic](https://img.shields.io/pypi/l/django-sitegate.svg)](https://pypi.python.org/pypi/django-sitegate)
[![coverage](https://img.shields.io/coveralls/idlesign/django-sitegate/master.svg)](https://coveralls.io/r/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 and log in flows for you.

**Sign in**

* username/e-mail + password
* username + password
* Yandex
* Google
* GitHub
* GitLab
* Discord
* Telegram
* Slack
* Twitch

**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

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:

    ```python
    from django.shortcuts import render

    from sitegate.toolbox 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.

    ```html
    {% 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.

## Documentation

<https://django-sitegate.readthedocs.io/>
