semvec/pypi-packages huggingface dataset:
django-mozilla-oidc-custom 0.1
A Django sso login based on django-mozilla-oidc.
Requires Python: >=3.10

# Django Mozilla OIDC Custom

`django-mozilla-oidc-custom` is a Django app that adds a custom login button to the Django admin login page using `django-mozilla-oidc`.
It does not allow direct authentication on the first SSO login but instead creates an **inactive user**.
The administrator must activate the user in the Django admin interface.

After activation, the user can log in using the SSO login button.

## Quick Start

1. Add `"django_mozilla_oidc_custom"` to your `INSTALLED_APPS` setting.  
   It must be **before** `"django.contrib.admin"`.

   ```python
   INSTALLED_APPS = [
       ...,
       "django_mozilla_oidc_custom",
       "django.contrib.admin",
       ...,
   ]
   ```

2. Add the following settings to your `settings.py` file:

   ```python

   # Required settings
   AUTHENTICATION_BACKENDS = (
       "django_mozilla_oidc_custom.authentication.DjangoMozillaOIDCCustomBackend",  # Authentication OIDC
       "django.contrib.auth.backends.ModelBackend",  # Classic authentication
   )

   # Add the admin_navbar context processor to templates settings
   TEMPLATES = [
       {
           "DIRS": [BASE_DIR / "templates"],
           "APP_DIRS": True,
           "OPTIONS": {
               "context_processors": [
                   "django_mozilla_oidc_custom.context_processors.admin_navbar",
               ],
           },
       },
   ]

   # Mozilla Django OIDC settings
   OIDC_RP_CLIENT_ID = os.environ["OIDC_RP_CLIENT_ID"]
   OIDC_RP_CLIENT_SECRET = os.environ["OIDC_RP_CLIENT_SECRET"]
   OIDC_RP_SCOPES = "openid email profile"
   OIDC_OP_AUTHORIZATION_ENDPOINT = os.environ["OIDC_OP_AUTHORIZATION_ENDPOINT"]
   OIDC_OP_TOKEN_ENDPOINT = os.environ["OIDC_OP_TOKEN_ENDPOINT"]
   OIDC_OP_USER_ENDPOINT = os.environ["OIDC_OP_USER_ENDPOINT"]
   OIDC_OP_JWKS_ENDPOINT = os.environ["OIDC_OP_JWKS_ENDPOINT"]
   OIDC_RP_SIGN_ALGO = os.environ.get("OIDC_RP_SIGN_ALGO", "RS256")

   # Custom settings
   DMOC_NEW_USER_GROUP_NAME = os.environ.get("NAME_GROUP_USER_TO_ADD_TO")
   LOGIN_REDIRECT_URL = "admin:index"
   LOGIN_REDIRECT_URL_FAILURE = "admin:index"

   # Override the OIDC callback class to use the custom one
   OIDC_CALLBACK_CLASS = "django_mozilla_oidc_custom.authentication.DjangoMozillaOIDCCustomCallbackView"
   ```

3. Include the app's URL configuration in `urls.py`:

   ```python
   from django.urls import path, include

   urlpatterns = [
       path("oidc/", include("django_mozilla_oidc_custom.urls")),
   ]
   ```

4. Start the development server and visit the admin login page to test the SSO login button.

## License
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
turtle-dragon 0.1.0
Draw a dragon curve using Python turtle graphics
Requires Python: >=3.11

<!--
SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
SPDX-License-Identifier: BSD-2-Clause
-->

# turtle-dragon - draw a dragon curve using Python turtle graphics

\[[Home][ringlet-home] | [GitLab][gitlab] | [PyPI][pypi] | [Python API][ringlet-api] | [ReadTheDocs][readthedocs]\]

## Overview

The `turtle-dragon` library provides a means to calculate the turns of
[a dragon curve][mathworld-dragon].
It also provides the `turtle-dragon` command-line tool that has three subcommands:

- `calc`: calculate the direction of a specified turn
- `run`: draw a dragon curve using Python turtle graphics
- `turns`: display the directions of the first specified number of turns

## Contact

The `turtle-dragon` library was written by [Peter Pentchev][roam].
It is developed in [a GitLab repository][gitlab].
This documentation is hosted at [Ringlet][ringlet-home] with a copy at [ReadTheDocs][readthedocs].

[roam]: mailto:roam@ringlet.net "Peter Pentchev"
[gitlab]: https://gitlab.com/ppentchev/turtle-dragon "The turtle-dragon GitLab repository"
[mathworld-dragon]: https://mathworld.wolfram.com/DragonCurve.html "The dragon curve article at Wolfram Mathworld"
[pypi]: https://pypi.org/project/turtle-dragon/ "The turtle-dragon Python Package Index page"
[readthedocs]: https://turtle-dragon.readthedocs.io/ "The turtle-dragon ReadTheDocs page"
[ringlet-api]: https://devel.ringlet.net/games/turtle-dragon/api/ "The turtle-dragon Python API at Ringlet"
[ringlet-home]: https://devel.ringlet.net/games/turtle-dragon/ "The Ringlet turtle-dragon homepage"