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
- Add "auth_tg" to your INSTALLED_APPS setting:
INSTALLED_APPS = [
...
'auth_tg',
]
- Add your Telegram Bot settings to settings.py:
BOT_TOKEN = 'your-bot-token'
BOT_USERNAME = 'your-bot-username'
- Include the auth_tg URLconf in your project urls.py:
path('auth/', include('auth_tg.urls')),
- Run migrations:
python manage.py migrate
- 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>
- You can add an additional checking on your telegram channels. Just add these without gap:
CHANNELS = '12345678910,12345678911'
CHANNEL_NAMES = '@channel1,@channel2'
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db32c3abdfe707223f5f451c7f8004a2c87e17194592fba77909671465a08560
|
|
| MD5 |
73fe242fdb6ab8e8f49ecb41da45f8ea
|
|
| BLAKE2b-256 |
d1e9df3795961c472edf30110772d33910d786e8eb8640df837bba4e2f08a081
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eaff3b03ee576f141f004dec39b5b0f52aeb5d7661d883d7889c3633352bad5
|
|
| MD5 |
5b058050fda6addb9fb829dbfeaf03cc
|
|
| BLAKE2b-256 |
b54ca09a48ffb1ba9a565add294adc1cb0792986216704e873fcdac8604b1a56
|