Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Use this simple module to easily enable authorization in your Django application via Twitch API

Project description

Wanna enable your awesome Django application to register and authenticate user using Twitch profiles?
This application was created especially for your needs

Features

  • Easy to use
  • Ready to Twitch channel name changes
  • Username cases are synchronized to Twitch display_name
  • User emails are synchronized to Twitch

Installation

Ensure that Django ‘sites’ framework is enabled.

Python package:

pip install django-simpletwitchauth

settings.py:

Add twitch_auth to INSTALLED_APPS

Add twitch_auth.backends.OAuth2Backend to AUTHENTICATION_BACKENDS

Set Twitch application settings

Example using django-environ:

env = environ.Env()

TWITCH_AUTH_CLIENT_ID = env('TWITCH_CLIENT_ID', default='some_client_id')
TWITCH_AUTH_CLIENT_SECRET = env('TWITCH_CLIENT_SECRET', default='some_client_secret')

All available settings:

TWITCH_AUTH_SCOPE

Defines OAuth2 token scope

Defaults to user_read

TWITCH_AUTH_PROTOCOL

Defines protocol that is used to build full authentication callback URI

Defaults to http://

TWITCH_AUTH_CLIENT_ID

Defines Twitch application client ID

TWITCH_AUTH_CLIENT_SECRET

Defines Twitch application client secret

TWITCH_AUTH_REDIRECT_URI

Defines default redirect URI after successful authentication

Defaults to /

Usage

  • Run migrations to create database tables for entities.
  • Add somewhere in your templates link to url login_twitch

Release history Release notifications

This version
History Node

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_simpletwitchauth-1.0-py2.py3-none-any.whl (12.9 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jul 7, 2017
django-simpletwitchauth-1.0.tar.gz (7.0 kB) Copy SHA256 hash SHA256 Source None Jul 7, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page