Skip to main content

Package to use Django ORM as persistence engine in Python Telegram Bot

Project description

python-telegram-bot-django-persistence

PyPI - Downloads All Contributors

Do you use python-telegram-bot or aiogram with Django and want storing FSM info without additional infrastructure?
We've got you covered!

Originally, this package supported only PTB, but we added aiogram, because it is awesome!

Quickstart

📥 Install package

If you are using poetry (and if not, please, consider using it 😉):

# For python-telegram-bot
poetry add "python-telegram-bot-django-persistence[ptb]"
# For aiogram
poetry add "python-telegram-bot-django-persistence[aiogram]"

Elif you are using pip, then just enter:

pip install python-telegram-bot-django-persistence

🔌 Add the app to your Django project

Then add python_telegram_bot_django_persistence into your INSTALLED_APPS in your settings file, like so:

INSTALLED_APPS = [
    ...
    "python_telegram_bot_django_persistence",  # For python-telegram-bot
    "aiogram_djpersistence",  # For aiogram
]

☢ Migrate your database

python manage migrate

🌟 Awesome! Now use it in your bot!

python-telegram-bot

updater = Updater(bot=bot, use_context=True, persistence=DjangoPersistence())

aiogram

dp = Dispatcher(storage=DjangoStorage())

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Alexander Shishenko
Alexander Shishenko

💻 📖
Raman Hutkovich
Raman Hutkovich

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

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

Built Distribution

File details

Details for the file python_telegram_bot_django_persistence-0.2.0.tar.gz.

File metadata

File hashes

Hashes for python_telegram_bot_django_persistence-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73f43f97922ce45dfb11602fd16a639883f5d89c7a20450adef172eed202c225
MD5 157bf3c4324b9c070e000b48f152c5fa
BLAKE2b-256 d09f8b7ea6b3cb95dddfafe42dc640f643a6158d8f33927e4460d8c63d76db79

See more details on using hashes here.

File details

Details for the file python_telegram_bot_django_persistence-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_telegram_bot_django_persistence-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a0efac4a1b66c032d08ebae193980fec9e3e7fddebd90b504a3faa9ed8257aa
MD5 8c27cc434136c4e6de4d9cf78475e951
BLAKE2b-256 82589e5a58a268053bab53df1cd57418762e26a90bd601feb4c3e7d8be221696

See more details on using hashes here.

Supported by

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