Metadata-Version: 2.2
Name: django-tgauth
Version: 0.1.3
Summary: App for Django and DRF which give an opportunity to login via TG.
Home-page: https://github.com/hraon88/tgauth
Author: hraon88
Author-email: irm7700@gmail.com
License: MIT
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<5.2,>=5.1.5
Requires-Dist: djangorestframework>=3.15.2
Requires-Dist: pyTelegramBotAPI>=4.26.0
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Django Telegram Authentication

Simple Django app for authentication via Telegram.

## Installation

```bash
pip install django-tgauth
````
## Quick start

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