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.10

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

Built distribution (wheel)

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

Total release size: 41.0 kB

Release files / django_dynamic_smtp-0.0.10.tar.gz

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

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

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

Security for django-dynamic-smtp 0.0.10

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