github_auth

A django application to login via github.


Keywords
github, auth, django, login, python, via-github
License
MIT
Install
pip install github_auth==0.0.7

Documentation

Github Auth

A django application to login with github.

MIT License releases last-commit Codacy Badge Code style Code style

Install

pip install github_auth

Usage

/settings.py

INSTALLED_APPS = [
    ...
    ...
    ...
    "github_auth",
]

LOGIN_REDIRECT_URL = "/" # after users login, they will redirect this url
LOGOUT_REDIRECT_URL = "/" # after users logout
GITHUB_AUTH = dict(
    redirect_uri="your_redirect_uri",
    scope="your scope",
    client_secret="your github client_secret",
    client_id="your github client_id",
)

/urls.py

urlpatterns = [
    ...
    ...
    ...
    path("accounts/github/", include('github_auth.urls')),
]

/templates

<a href="{% url 'redirect-github' %}">
    login wia github
</a>
request.user.github_auth.get_extra_data_as_dict.name # and other fields
request.user.github_auth.avatar_url