|
||
---|---|---|
README.md | ||
__init__.py | ||
admin.py | ||
apps.py | ||
backends.py | ||
models.py | ||
tests.py | ||
utils.py | ||
views.py |
README.md
Gitea Auth App for Django Social Auth
Adding to a project:
settings.py
GITEA_INSTANCE_URL = "https://gt.kalli.st"
INSTALLED_APPS = [
...
"social_django",
"gitea_auth",
]
AUTHENTICATION_BACKENDS = ["gitea_auth.backends.OAuth2"]
SOCIAL_AUTH_PIPELINE = [
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.user.get_username',
'social_core.pipeline.social_auth.associate_by_email',
'social_core.pipeline.user.create_user',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
]
SOCIAL_AUTH_URL_NAMESPACE = 'auth'
CLIENT_KEY_AND_SECRET = {
"kalli.st" : ("key", "secret" )
}
LOGIN_REDIRECT_URL = '/admin/'
urls.py
from django.urls import path, include
urlpatterns = [
...
path("auth/", include("social_django.urls", namespace="auth"), name="auth"),
]