A Django app that integrates with Telegram to create bots.
Project description
django-telegram-app
A Django app to integrate Telegram bots into your project.
Detailed documentation is in the docs/ directory.
Features
- ✅ Command-based bot architecture with step-based flow
- ✅ Swappable
TelegramSettingsmodel - ✅ Inline admin integration for linking Telegram settings to users
- ✅ Extensible: add commands per app via auto-discovery
- ✅ Built-in system checks for misconfiguration
- ✅ Django ORM integration (no direct API handling required)
- ✅ Easy to test (includes custom TelegramTestCase)
Requirements (officially supported)
- Python 3.10+
- Django 5.2+
Quick start
-
Install the package
pip install django-telegram-app
-
Add "django_telegram_app" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ..., "django_telegram_app", ]
-
Include the telegram URLconf in your project urls.py like this:
... from django_telegram_app.conf import settings as telegram_app_settings ... path(telegram_app_settings.ROOT_URL, include("django_telegram_app.urls")),
-
Create your own commands in each app under
{appname}/telegrambot/commands/. Refer to the documentation for more details on how to write custom commands. -
Add the provided telegramsettings inline to your user-model like this:
# user/admin.py from django_telegram_app.admin import TelegramSettingInline ... class CustomUserAdmin(UserAdmin): ... inlines = [TelegramSettingInline] # or add it to an existing entry
-
Configure the telegram settings. Refer to the documentation for all possible settings. Minimal configuration is like this:
# project/settings.py ... TELEGRAM = { "BOT_URL": "https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/" } ...
-
Run
python manage.py migrateto create the models. -
Run
python manage.py setwebhookto set the url on which you would like to receive telegram updates. -
Start the development server and visit the admin to edit users and add/complete TelegramSettings there.
License
This project is licensed under the MIT License — see the LICENSE file for details.
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
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_telegram_app-0.1.4.tar.gz.
File metadata
- Download URL: django_telegram_app-0.1.4.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd6eef8e4a8550e87a0897453c4480874e6066b50e61dbbf1ccb2d22fdccc3b6
|
|
| MD5 |
5798aef6b654fefb158f46f5ca8c5222
|
|
| BLAKE2b-256 |
74d6ceac631f3e731f179943a4559cf4f23a7af8e24469b843e9d801a07350ee
|
Provenance
The following attestation bundles were made for django_telegram_app-0.1.4.tar.gz:
Publisher:
release.yml on shifqu/django-telegram-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_telegram_app-0.1.4.tar.gz -
Subject digest:
fd6eef8e4a8550e87a0897453c4480874e6066b50e61dbbf1ccb2d22fdccc3b6 - Sigstore transparency entry: 699407765
- Sigstore integration time:
-
Permalink:
shifqu/django-telegram-app@ad8f9bc227a99e02a7bcb10ac689e80dd5a7e0bf -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/shifqu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ad8f9bc227a99e02a7bcb10ac689e80dd5a7e0bf -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_telegram_app-0.1.4-py3-none-any.whl.
File metadata
- Download URL: django_telegram_app-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a926efac1a32ded8ff5ff34f14df8c02f894f90f640611b423d7ec27c2a9edf
|
|
| MD5 |
53d6c0b24a10e00865d905f72e12885e
|
|
| BLAKE2b-256 |
4f456379dacb22c6d2e2f753d5c95bd78c2f1c9bc867b4bea33859c47721ace4
|
Provenance
The following attestation bundles were made for django_telegram_app-0.1.4-py3-none-any.whl:
Publisher:
release.yml on shifqu/django-telegram-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_telegram_app-0.1.4-py3-none-any.whl -
Subject digest:
2a926efac1a32ded8ff5ff34f14df8c02f894f90f640611b423d7ec27c2a9edf - Sigstore transparency entry: 699407777
- Sigstore integration time:
-
Permalink:
shifqu/django-telegram-app@ad8f9bc227a99e02a7bcb10ac689e80dd5a7e0bf -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/shifqu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ad8f9bc227a99e02a7bcb10ac689e80dd5a7e0bf -
Trigger Event:
push
-
Statement type: