Skip to main content

Django dynamic SMTP

Configure email configuration in the admin.

Usage

  1. Install with pip install django-dynamic-smtp

  2. Add dynamic_smtp and some dependencies to INSTALLED_APPS:

INSTALLED_APPS = [
    ...,
    "django_object_actions",
    "dynamic_smtp",
]
  1. Configure your email backend:
EMAIL_BACKEND = (
    "django.core.mail.backends.console.EmailBackend"
    if DEBUG
    else "dynamic_smtp.email.DynamicSMPTEmailBackend"
)
  1. Migrate: ./manage.py migrate
  2. Access you admin and configure your SMTP settings

Optional dependency: tinymce (HTML editor in admin)

  1. Add dynamic_smtp and some dependencies to INSTALLED_APPS:
INSTALLED_APPS = [
    ...,
    "tinymce",
]
  1. Configure tinymce. Example:
TINYMCE_JS_URL = "https://cdnjs.cloudflare.com/ajax/libs/tinymce/7.0.1/tinymce.min.js"
TINYMCE_DEFAULT_CONFIG = {
    "theme": "silver",
    "height": 600,
    "width": 700,
    "resize": "both",
    "plugins": "advlist,autolink,lists,link,image,charmap,print,preview,anchor,"
    "searchreplace,visualblocks,code,fullscreen,insertdatetime,media,table,paste,"
    "help,wordcount",
    "license_key": "gpl",
}

See django-tinymce's documentation for more options.

Customize model model admin

  1. Don't let our app register the default model admin, and register your new model as the holder of email configurations.
# settings.py

...
DYNAMIC_SMPT_REGISTER_ADMIN = False
DYNAMIC_SMPT_EMAIL_CONFIGURATION_MODEL = "myapp.EmailConfiguration"
  1. Create your custom model
# myapp/models.py

from dynamic_smtp.models import AbstractEmailConfiguration

class EmailConfiguration(AbstractEmailConfiguration):
    pass
  1. Create your custom model admin
# myapp/admin.py

from django.contrib import admin
from dynamic_smtp.models import AbstractEmailConfiguration

from .models import Emailconfiguration


@admin.register(EmailConfiguration)
class CustomModelAdmin(EmailConfigurationAdmin):
    class Media:
        css = {"all": ["myapp/style.css"]}

Dependencies

This package needs quite a few dependencies, considering its simplicity.

  • Django
  • beautifulsoup4 and lxml: prepare text version of HTML emails
  • django-object-actions: Button for email test
  • django-solo: Use singleton model

Contributing

All contributions are welcome! To setup you environment:

  1. pip install -r dev.requirements.txt (or uv sync --dev)
  2. pre-commit install

Metadata

Release files for django-dynamic-smtp 0.0.9

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-dynamic-smtp 0.0.9
File Size Uploaded Provenance Actions
django_dynamic_smtp-0.0.9.tar.gz 31.5 kB Without provenance Details for django_dynamic_smtp-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-dynamic-smtp 0.0.9
File Interpreter ABI Platform Actions
django_dynamic_smtp-0.0.9-py3-none-any.whl Python 3 none any Details for django_dynamic_smtp-0.0.9-py3-none-any.whl

Total release size: 41.1 kB

Release files / django_dynamic_smtp-0.0.9.tar.gz

Download URL django_dynamic_smtp-0.0.9.tar.gz
Size 31.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c630e97b48fa2eda1a810e4d450d02d34fea60d129bae1431d7397d89a827ba0
BLAKE2b-256 checksum
How to use checksums
96fcf47fdfcfec1c75edbf2e59cd91856260738428fd797a3154cdb0489c6951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.15

Release files / django_dynamic_smtp-0.0.9-py3-none-any.whl

Download URL django_dynamic_smtp-0.0.9-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5341c9e0ca63d9c0c1f8eab8feed58fc320203a9adfbb2ff3cbdcd551b145aed
BLAKE2b-256 checksum
How to use checksums
f153291d9413206a3f3a7917d98fb306908e3bfa3ecb287d51bf98cb0f946881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.15

Security for django-dynamic-smtp 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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