Configure email settings in the admin
Project description
Django dynamic SMTP
Configure email configuration in the admin.
Usage
-
Install with
pip install django-dynamic-smtp -
Add
dynamic_smtpand some dependencies toINSTALLED_APPS:
INSTALLED_APPS = [
...,
"django_object_actions",
"tinymce",
"dynamic_smtp",
]
- Configure your email backend:
EMAIL_BACKEND = (
"django.core.mail.backends.console.EmailBackend"
if DEBUG
else "dynamic_smtp.email.DynamicSMPTEmailBackend"
)
- Migrate:
./manage.py migrate - 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.
- Access you admin and configure your SMTP settings
Customize model admin
- Don't let our app register the default model admin:
# settings.py
...
DYNAMIC_SMPT_REGISTER_ADMIN = False
DYNAMIC_SMPT_REGISTER_MODEL = False
- Register your custom admin
# myapp/models.py
from dynamic_smtp.models import AbstractEmailConfiguration
class EmailConfiguration(AbstractEmailConfiguration):
pass
# 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.
Djangobeautifulsoup4andlxml: prepare text version of HTML emailsdjango-object-actions: Button for email testdjango-tinymce: Button for email testdjango-solo: Use singleton model
Contributing
All contributions are welcome! To setup you environment:
pip install -r dev.requirements.txtpre-commit install
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_dynamic_smtp-0.0.3.tar.gz.
File metadata
- Download URL: django_dynamic_smtp-0.0.3.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc75adac6bb92cfe65091f7a99894ae3489c022210f1de806a9bbecf342094d6
|
|
| MD5 |
907d2cefe3d570da5722deb67420ff59
|
|
| BLAKE2b-256 |
1452c0f86f008cf1c3ed28d7d396bb0f287a84ae4f987f2ecab180f1e87a297f
|
File details
Details for the file django_dynamic_smtp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: django_dynamic_smtp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa97ecf95bd9cc84b4394c98303b0ed7264b7ccba73494e754417308ebccb621
|
|
| MD5 |
b3513573d0037e7cef2bb5fe03744c76
|
|
| BLAKE2b-256 |
d460a76b0f96779cf24a83c5c7f29d807345307888f93358e799f2fcd03ea4ca
|