Skip to main content

App for Django and DRF which give an opportunity to login via TG.

Project description

Django Telegram Authentication

Simple Django app for authentication via Telegram.

Installation

pip install django-tgauth

Quick start

  1. Add "auth_tg" to your INSTALLED_APPS setting:
INSTALLED_APPS = [
    ...
    'auth_tg',
]
  1. Add your Telegram Bot settings to settings.py:
BOT_TOKEN = 'your-bot-token'
BOT_USERNAME = 'your-bot-username'
  1. Include the auth_tg URLconf in your project urls.py:
path('auth/', include('auth_tg.urls')),
  1. Run migrations:
python manage.py migrate
  1. If you want to use your own base.html then you need to add this into your html file.
<script src="{% static 'auth_tg/js/telegramAuth.js' %}"></script>
  1. You can add an additional checking on your telegram channels. Just add these without gap:
CHANNELS = '12345678910,12345678911'
CHANNEL_NAMES = '@channel1,@channel2'

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_tgauth-0.1.3.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tgauth-0.1.3-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file django_tgauth-0.1.3.tar.gz.

File metadata

  • Download URL: django_tgauth-0.1.3.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for django_tgauth-0.1.3.tar.gz
Algorithm Hash digest
SHA256 db32c3abdfe707223f5f451c7f8004a2c87e17194592fba77909671465a08560
MD5 73fe242fdb6ab8e8f49ecb41da45f8ea
BLAKE2b-256 d1e9df3795961c472edf30110772d33910d786e8eb8640df837bba4e2f08a081

See more details on using hashes here.

File details

Details for the file django_tgauth-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: django_tgauth-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for django_tgauth-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5eaff3b03ee576f141f004dec39b5b0f52aeb5d7661d883d7889c3633352bad5
MD5 5b058050fda6addb9fb829dbfeaf03cc
BLAKE2b-256 b54ca09a48ffb1ba9a565add294adc1cb0792986216704e873fcdac8604b1a56

See more details on using hashes here.

Supported by

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