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

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

Built distribution (wheel)

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

Total release size: 41.2 kB

Release files / django_dynamic_smtp-0.0.11.tar.gz

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

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

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

Security for django-dynamic-smtp 0.0.11

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