Skip to main content

django-tbot-mailing

Установка

pip install django-tbot-mailing

Настройка

В settings.py

...
INSTALLED_APPS = [
    ...,
    'tbot_base'
    'tbot_mailing'
]

BOT_HANDLERS = [        # для tbot_base
    'tbot.dispatcher',
]

MAILING_USERMODEL = 'tbot.User' # укажите модель пользователя 

from .celery import app
CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_APP = app # приложение celery созданное в celery.py проекта

MEDIA_ROOT = 'media/'

Необходимые для работы модуля опции - MAILING_USERMODEL и CELERY_APP.
В модели пользователя, указанной в MAILING_USERMODEL должно присутствовать поле user_id
Также, для корректного сохранения изображений рассылки укажите MEDIA_ROOT

Далее, выполняем миграции

./manage.py makemigrations && ./manage.py migrate

Не забудьте запустить celery

celery -A proj worker -E

Использование

Создать и запланировать рассылку вы можете в админ-панели

Release files for django-tbot-mailing 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-tbot-mailing 0.1.1
File Size Uploaded
django-tbot-mailing-0.1.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-tbot-mailing 0.1.1
File Interpreter ABI Platform
django_tbot_mailing-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / django-tbot-mailing-0.1.1.tar.gz

Download URL django-tbot-mailing-0.1.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
938689e2a2e42feeebc40e1ee8cee21c6e8f38b362475e85040a9ef7697de85e
BLAKE2b-256 checksum
How to use checksums
ec6097fa93d8d697fe850c47b886943506d4b0ccf58bca292db451a8fbba8fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / django_tbot_mailing-0.1.1-py3-none-any.whl

Download URL django_tbot_mailing-0.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b997c002e44bf3d54c846b9d101c5071e91c0bebfcae739d3cdebfd6a1c4bb64
BLAKE2b-256 checksum
How to use checksums
5be7d6d12966564be62b0accb436c13ca2fdebaa6965cb351f7b2b65b64b0e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page