Skip to main content

A simple Dingding auth Django app.

Project description

Dingo-Auth-Dingding

a dingding app auth django app. you should have follow this section to configure dingding app.

Quick start

  1. Add "polls" to your INSTALLED_APPS setting like this::
 INSTALLED_APPS = [
 ...
 'django_auth_dingding',
 ]
  1. Include the URLconf in your project urls.py like this::
path('dingding/', include("django_auth_dingding.urls")),
  1. Add ding_user_id field to User Model like this::
from django.contrib.auth.models import AbstractUser

class Users(AbstractUser):
    ...
    ding_user_id = models.CharField("钉钉UserID", max_length=64, blank=True)
  1. Setting config in your django's settings.py like this::
INSTALLED_APPS += ("django_auth_dingding",)
AUTHENTICATION_BACKENDS = (
    "django_auth_dingding.auth.DingdingAuthenticationBackend",
    "django.contrib.auth.backends.ModelBackend",
)
DINGDING_AUTH_AUTHENTICATION_CALLBACK_URL = env("DINGDING_AUTH_AUTHENTICATION_CALLBACK_URL")
DINGDING_AUTH_APP_KEY = env("DINGDING_AUTH_APP_KEY")
DINGDING_AUTH_APP_SECRET = env("DINGDING_AUTH_APP_SECRET")
  1. Run python manage.py migrate to Modify the User models.

  2. Browser visit http://{host}:{port}/dingding/authenticate/ will redirect to dingding auth page

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_auth_dingding-0.0.3.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

django_auth_dingding-0.0.3-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page