Saravanan666/pypi-org huggingface dataset:
Package: django-email-hosts
Why?Some projects may want to sent emails over multiple SMTP relays or smarthosts.
Examples are sites running on multiple domains, e.g.info@example.comandinfo@example.org. It may be possible to use the same SMTP credentials for
each sender address but if that isn’t possible django-email-hosts may be a good
solution for the problem.UsageInstall:pip installdjango-email-hostsConfigure: Add theEMAIL_HOSTSsettingUse: Always explicitly use the SMTP connection returned byemail_hosts.backends.get_connectionEMAIL_HOSTSThe keys of theEMAIL_HOSTSdictionary are defined by you and there’s no
deeper meaning to them. The values are DSNs inspired bydj-email-urlDSNs.An example configuration (which is possibly nonsensical) looks like this:EMAIL_HOSTS={"sendgrid":"submission://USER:PASSWORD@smtp.sendgrid.com?_default_from_email=info@example.com","mailgun":"submission://USER:PASSWORD@smtp.mailgun.com?_default_from_email=info@example.org",}This configuration creates two SMTP backends, one using sendgrid and one using
mailgun. The_default_from_emailis completely optional. If the email
message’sfrom_emailisn’t set (resp. is equal to theDEFAULT_FROM_EMAILsetting) it automatically defaults to the per-backend
value.email_hosts.backends.get_connectionTheget_connectionfunction expects a single key for theEMAIL_HOSTSsetting above. Sending a single email using an explicit connection may look as
follows, using the settings from above:fromdjango.core.mailimportEmailMessagefromemail_hosts.backendsimportget_connectionEmailMessage("Hello","World",to=["recipient@example.com"],connection=use_backend("sendgrid"),).send()get_connectioncurrently silently returns the default email backend if the
key doesn’t exist in theEMAIL_HOSTSdictionary.
Package: django-email-html
# Django Email HTML[![Build Status](https://travis-ci.org/ramusus/django-email-html.png?branch=master)](https://travis-ci.org/ramusus/django-email-html)This application can be used for quickly switching all emails from plain-text to html. For using it you need to do 2 steps:addemail_htmltoINSTALLED_APPShigher, then other third-party applications;change all email templates to new html version;Application substitutes built-insend_mailfunction by new smartsend_mailfunction.build-in:send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None)new:send_mail(subject, message, from_email=None, recipient_list=None, fail_silently=False, auth_user=None, auth_password=None, connection=None)## Few new features:Message attribute using for html or plain-test message body. If it contains html, plain-text body will generated automatically based on html version;from_emailattribute is not required. By default it will set fromsettings.DEFAULT_FROM_EMAIL;Depending onsettings.EMAIL_ADMIN_DUPLICATEall copies of email messages also sending toADMINemails (using bcc header);New function can be used:send_mail(subj, html, recipient_list=emails)## Requirements:beautifulsoup4w3m (for generating plain-text from html)## Important notes:Placeemail_htmlapplication inINSTALLED_APPSbefore all other applications, which sending emails you need to make html based by default;Html body must contains<html>tag, otherwise function would think this is a plain-text body;
Package: django-email-interceptor
Django email interceptor provides email backends to intercept outgoing mail and mail them to a specified email instead.QuickstartInstall via pippipinstalldjango-email-interceptorAdd to installed apps:INSTALLED_APPS=(...'email_interceptor',...)Change the email backend to use interceptor and set an email to send the intercepted mail to:EMAIL_BACKEND='email_interceptor.backends.SmtpInterceptorBackend'INTERCEPTOR_EMAIL='test@example.com'TestingTo run tests, install the requirements for testing and run!pipinstall-rrequirements/test.txtpythonruntests.py
Package: django-emailit
TODO: make the docs nicerDeadsimple html email sending.addemailitfor the bundled templates andabsolutefor easy full absolute urls toINSTALLED_APPS.usage:import emailit.api
context = {
    'my_obj': 'whatever',
}
emailit.api.send_mail(['email@domain.com'], context, 'mymails/example_email')now add these templates:mymails/example_email.body.html
mymails/example_email.body.txt
mymails/example_email.subject.txtthe convention is, that the body templates should extendemailit/base_email.body.html/emailit/base_email.body.txtand overrid thecontentblock. This makes it easy to provide a site-wide look
to all emails using this system by overridingemailit/base_email.body.*.If thebody.htmltemplate is not found, a simple text email is sent. If thebody.txttemplate is missing,
it will be a pure html email.HTML emails are passed throughpremailer.languagecan be passed into thesend_mailfunction to override the active language while rendering the mail.The body templates will contain the renderedsubjectvariable in their context.subjectcan also be passed directly intosend_mail.
Package: django-email-log
Django email backend that logs all sent emails to a database using a Django model.This app works with Django 2.2 to 4.2This app requires Python 3.7+.Getting HelpDocumentation for django-email-log is available athttps://django-email-log.readthedocs.org/This app is available onPyPI.Submit issues on Github:https://github.com/treyhunner/django-email-log/issuesPull requests are welcome.  Read the CONTRIBUTING file for tips on submitting
a pull request.Related ProjectsThanks to the following related projects for inspiration:django-mailerdjango-post_officedjango-celery-emailEmail logger mentioned in thisStackOverflow answerCHANGES1.4.0 (2023-04-06)Added ability to assign callable toEMAIL_LOG_ATTACHMENTS_PATHAdded Django 4.2 support1.3.0 (2023-02-10)Added Django 4.1 supportRemove Python 3.6 supportAdd saving of e-mail attachemnts to databaseAdd saving of html alternatives to database1.2.0 (2022-02-08)Set default_auto_field in apps.py (#23)Send email even when we can’t write the database (#14)Fix Django warningsImprove CI/pre-commit/formatting (we’re using Black now)1.1.0 (2022-01-27)Added Django 3.2 and 4.0 supportDropped Django support for 2.1 and belowDropped Python 3.5 supportThanks to Alexey Kotenko and Craig Anderson for PRs1.0.0 (2020-05-19)Added Django 2.x support and Django 3.x supportAdded tests for newer versions of Python 3Dropped Django support for 1.10 and belowDropped Python 2 supportThanks to Mark Jones and Oleg Belousov for attempted PRs0.2.0 (2014-08-03)Added Django 1.6 and Django 1.7 support.Added German and Brazilian Portuguese translations (#3 and #9).  Thanks
Jannis and Rodrigo Deodoro.Fixed email log app name on admin website.Output email body in admin interface with linebreaks shown correctly (#6).
Thanks Keryn Knight.0.1.0 (2013-05-02)Initial release.
Package: django-email-log-backend
pipinstalldjango-email-log-backendorpipinstall-e'git+https://github.com/mireq/django-email-log-backend.git#egg=django_email_log_backend'SettingsINSTALLED_APPS=(# ...'django_email_log',)EMAIL_BACKEND='django_email_log.backends.EmailBackend'EMAIL_LOG_BACKEND='django.core.mail.backends.console.EmailBackend'Emails are forwarded toEMAIL_LOG_BACKEND.# urls.pyurlpatterns=[# ...path('django-email-log/',include('django_email_log.urls')),]Screenshots
Package: django-emaillog-backend
Django EmailLog BackendSimple email backend for Django that writes messages to logger instead of sending them to a SMTP server.InstallationInstallation is easy usingpippipinstalldjango-emaillog-backendUsageTo ensure that all emails sent using the send_mail function of Django are sent to a log you must add the following line to yoursettings.pyfile:EMAIL_BACKEND='django_emaillog_backend.backends.LoggerBackend'You can specify the logger to which the logs will be sent adding it to thesettings.pyfileEMAIL_LOGGER_NAME='your_logger_name'For example, you can create a custom logger to test the correct behaviour of sending mails as follow:# Add a custom logger to test mailsLOGGING={'version':1,'disable_existing_loggers':False,'formatters':{...},'handlers':{...},'loggers':{...'email_logger':{'handlers':['your_handler'],'propagate':True,'level':'DEBUG',},}}# Configure the email backendEMAIL_BACKEND='django_emaillog_backend.backends.LoggerBackend'EMAIL_LOGGER_NAME='email_logger'The default logger fordjango-emaillog-backendis the global Django logger called 'django'.It is also possible to choose the severity level of messages sent to the logger adding the following to yoursettings.pyfile:EMAIL_LOGGER_LEVEL=logger_levelEMAIL_LOGGER_LEVELexpects an integer. We recommend using the severity levels of the logging module:logging.DEBUG(10)logging.INFO(20)logging.WARNING(30)logging.ERROR(40)logging.CRITICAL(50)For example:importloggingEMAIL_LOGGER_LEVEL=logging.INFOThe default log level isINFO.
Package: django-email-login
GoalsThe goal of this app is to easily transform django’s auth system to allow
login with an email adress, instead of a username. This should work inside the
admin as well as outside. Therefore, email adresses need to be unique.The username of the User will be the hash of it’s email adress. As it means
nothing, it will be hidden in the admin changelist view.InstallInstall withpip installdjango-email-loginor checkout from Bitbuckethg clonehttps://bitbucket.org/tino/django-email-loginand runpython setup.py install.UsageAppend'email_login'to yourINSTALLED_APPSsettingInsert'email_login.auth_backend.EmailBackend'as first in theAUTHENTICATION_BACKENDSsettings tuple.Add the following in you rooturls.pyafteradmin.autodiscover():# Insert email_login overrides
from email_login import useradmin, adminsite
site = adminsite.EmailLoginAdminSite()
# duplicate the normal admin's registry until ticket #8500 get's fixed
site._registry = admin.site._registryInstead of using:# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),use:# Uncomment the next line to enable the admin:
(r'^admin/', include(site.urls)),to include the admin in your rooturls.py.To use login outside of the admin, add:(r'^account/', include('email_login.urls')),to yoururls.pyNoteYour admin account needs to have an email address, otherwise you won’t be
able to sign in!NoteThe admin will display the username in the top right corner of the logged
in user if the user has no firstname. If you want to override that, over-
ride theadmin/base.htmltemplate.In conjunction with django-user-creationIf you want to use this app in conjunction withdjango-user-creation, you
have to create your ownModelAdminforUser. You may do so by adding auseradmin.pyfile to your project with the following contents:from django.contrib import admin
from django.contrib.auth.models import User
from user_creation.forms import EmailAccountCreationForm
from email_login.useradmin import EmailLoginAdmin


class MyUserAdmin(EmailLoginAdmin):
    add_form = EmailAccountCreationForm
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('email', 'password1', 'password2', 'email_user')}
        ),
    )

admin.site.unregister(User)
admin.site.register(User, MyUserAdmin)and adding the lineimport useradminto yoururls.pyafterthe
overrides described above.
Package: django-email-login-fc
django-email-loginLog in via email for django 1.4. Forked fromdjango-email-loginGoalsThe goal of this app is to easily transform django’s auth system to allow
login with an email adress, instead of a username. This should work inside the
admin as well as outside. Therefore, email adresses need to be unique.The username of the User will be the hash of it’s email adress. As it means
nothing, it will be hidden in the admin changelist view.InstallInstall withpip installdjango-email-loginor checkout from Bitbuckethg clonehttps://bitbucket.org/tino/django-email-loginand runpython setup.py install.UsageAppend'email_login'to yourINSTALLED_APPSsettingInsert'email_login.auth_backend.EmailBackend'as first in theAUTHENTICATION_BACKENDSsettings tuple.Add the following in you rooturls.pyafteradmin.autodiscover():# Insert email_login overrides
from email_login import useradmin, adminsite
site = adminsite.EmailLoginAdminSite()
# duplicate the normal admin's registry until ticket #8500 get's fixed
site._registry = admin.site._registryInstead of using:# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),use:# Uncomment the next line to enable the admin:
(r'^admin/', include(site.urls)),to include the admin in your rooturls.py.To use login outside of the admin, add:(r'^account/', include('email_login.urls')),to yoururls.pyNoteYour admin account needs to have an email address, otherwise you won’t be
able to sign in!NoteThe admin will display the username in the top right corner of the logged
in user if the user has no firstname. If you want to override that, over-
ride theadmin/base.htmltemplate.In conjunction with django-user-creationIf you want to use this app in conjunction withdjango-user-creation, you
have to create your ownModelAdminforUser. You may do so by adding auseradmin.pyfile to your project with the following contents:from django.contrib import admin
from django.contrib.auth.models import User
from user_creation.forms import EmailAccountCreationForm
from email_login.useradmin import EmailLoginAdmin


class MyUserAdmin(EmailLoginAdmin):
    add_form = EmailAccountCreationForm
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('email', 'password1', 'password2', 'email_user')}
        ),
    )

admin.site.unregister(User)
admin.site.register(User, MyUserAdmin)and adding the lineimport useradminto yoururls.pyafterthe
overrides described above.
Package: django-email-manager
Django Email Manager-----------![Continuous Integration Status](https://secure.travis-ci.org/paulocheque/django-email-manager.png?branch=master)A simple application to manage emails sent by a Django application.# Installation```pip install django-email-manager```or```# Download zip file# Extract it# Execute in the extracted directory: python setup.py install```#### Upgrade```pip install django-email-manager --upgrade --no-deps```# Motivation* <http://djangopackages.com/grids/g/email>* Problem: Bad control of what and how many e-mails have being sent to users.* Solution: A simple table that log a summary of each e-mail had been sent.A daily routine avoid this table grows uncontrolled and use the data to generate statistics.* Problem: Important e-mails are deleted from the database when a user change his e-mail.* Solution: A simple table that store all e-mails independently.* Usually, good systems do not send attachments by e-mail because this a open door to attacks.# Configuration* settings.py:```pythonINSTALLED_APPS = ('django.contrib.auth','django.contrib.admin','email_manager',)# This attribute activates a listener to store all e-mails independently of auth_user database.EMAIL_DATABASE_ACTIVATED = True# If you want to use celery for sending e-mails, you can customize the task name, example:EMAIL_MANAGER_USING_CELERY = True # default = FalseEMAIL_MANAGER_TASK = 'email-manager-task' # default = None```* urls.py```pythonfrom django.contrib import adminadmin.autodiscover()urlpatterns = patterns('',url(r'^admin/', include(admin.site.urls)),(r'^email-manager/', include('email_manager.urls', namespace='email_manager', app_name='email_manager')),)```* Templates:```python{% url email_manager:define_email_preferences user.id %}{% if user.is_superuser %}{% url email_manager:send_email_to_groups %}{% url email_manager:send_email_to_users %}{% url email_manager:update_statistics %}{% endif %}```# Usage* Manual Test:```/email-manager/send-email-to-groups//email-manager/send-email-to-users//email-manager/update-statistics//email-manager/define_email_preferences/USER_ID```* Send e-mails directly in source code:```pythonfrom email_manager.feature_send_email import EmailSenderEmailSender().send_email(emails, subject, text_content, html_content, main_content)EmailSender().send_email_to_users(users, additional_emails, subject, content, html_content, email_type)EmailSender().send_email_to_groups(groups, additional_emails, subject, content, html_content, email_type)```* Manual updating statistics:```python manage.py update_email_statistics```# Change Log## Version 0.2.1* 2012/04/08 (yyyy/mm/dd)* <http://pypi.python.org/pypi/django-email-manager/0.2.1>* Fixing configuration of package## Version 0.2.0* 2012/02/11 (yyyy/mm/dd)* <http://pypi.python.org/pypi/django-email-manager/0.2.0>* Now emails can have types and users can define which types of e-mails they want to receive.## Version 0.1.0* 2012/02/05 (yyyy/mm/dd)* <http://pypi.python.org/pypi/django-email-manager/0.1.0>* Initial version# TODO:* Auto update statistics* Simple graphs and reports
Package: django-email-notification
Notifications are short emails sent to users by Facebook or Twitter to inform users of some changes.django-email-notification allows backoffice users to send short email notifications to django registered users or users you only know the email about what is new or changed from django’s admin or a dedicated view. And then track their clicks.installation:pip install django-email-notificationsettings:NOTIFICATION_TEMPLATE = 'email'  # name of the templates to use (without extension). Must have a .txt and a .html version
NOTIFICATION_FROM_EMAIL = ''  # sender email, typically no-reply@you-site.com
NOTIFICATION_FROM_NAME = ''   # sender name
NOTIFICATION_UNSUBSCRIBE_REDIRECT = '/you-unsubscribed/'  # possible page redirection after unsubscription
NOTIFICATION_REGISTRATION_MESSAGE_TAG = 'notification'  # allow filtering notification messages

# Description of linkable objects.
NOTIFICATION_ASSOCIATED_OBJECTS = (
    {   'name': 'products',                                     # reference name, used in forms and templates
        'description': u"New products",                         # Human readable description
        'long_description': u"Last products added to our site", # Long description
        'class': 'project.application.models.Product',          # path to the class model
        'title_attr': 'product_description',                    # Model instance field or callable to display in form
        'order_by': '-creation_date',                           # order to sort Model instances in form and email template
        'manager': '',                                          # manager to use if so
    },
)Email template:In template, linked objects can be processed this way by example:{% if object_types.OBJECT_NAME.instances %}
    <ul><li>{{ object_types.OBJECT_NAME.long_description }}
    <ul>{% for instance in object_types.OBJECT_NAME.instances %}
    <li>{% include 'notification/emails/tracked_link.html' %}</li>
    {% endfor %}</ul>
    </li></ul>
{% endif %}Messages sent through the django messages framework filtered like this:{% if messages %}
    {% for message in messages %}
        {% if 'notification' in message.tags %}
            <span class="email-registration-message lvl-{{ message.level }}">{{ message }}</span>
        {% endif %}
    {% endfor %}
{% endif %}
Package: django-email-password-reset
Minimalist app disabling all passwords and sending password reset emails.UsageInstall app:pip install django-password-resetIncludepassword_resetapp inINSTALLED_APPS.Setup password reset template inpassword_reset/email.txtandpassword_reset/email_subject.txt.Do a dry-run, outputting emails to the console instead of sending them:./manage.py reset_passwords -nDisable all passwords and send reset emails to all users with management command:./manage.py reset_passwords
Package: django-email-queue
Queening and storing EMAIL_BACKEND for django.Free software: GNU Affero General Public License v3Documentation:https://django-email-queue.readthedocs.io.No change in django send_messages usage to get message storingYou don’t have to change the way you send messages, this app will plugin into the usual django plumbing.This way all the email send though django EMAIL_BACKEND will get stored for auditing.No overhead infrastructureYou don’t have to setup overhead infrastructure (e.g. celery, redis and rabbitmq) just to send emails
asynchronously. You can use a simple worker that will send queued emails.When you get big and having a MQ and all that is a good choice, all you have to to is set
EMAIL_QUEUE_EMAIL_BACKEND to ‘djcelery_email.backends.CeleryEmailBackend’.
This way you get message storing for auditing and will use pro setup for asynchronously ran tasks.QuickstartInstall Django email queue:pip install django-email-queueThis is a plugin replacement for your current EMAIL_BACKEND. You’ll still use it to send actual messages,
but before them they’ll get stored and queued in models visible from admin panel.EMAIL_BACKEND='django_email_queue.backends.EmailBackend'EMAIL_QUEUE_EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend'INSTALLED_APPS=[...'django_email_queue.apps.DjangoEmailQueueConfig',]Now you have a few options to setup queue processingRundjango_email_queue.workerfrom terminal to continuously send emails:python-mdjango_email_queue.workerSet EMAIL_QUEUE_SLEEP_TIME to number of settings to sleep between runs.Run django command to process queue and exit:pythonmanage.pysend_queued_messagesManually from django admin for :Running TestsDoes the code actually work?$ pipenv install --dev
$ pipenv shell
$ toxWe recommend usingpipenvbut a legacy approach to creating virtualenv and installing requirements should also work.
Please installrequirements/development.txtto setup virtual env for testing and development.CreditsThis package was created withCookiecutterand thewooyek/cookiecutter-django-appproject template.History0.9.17 (2018-01-02)First release on PyPI.
Package: django-email-registration
The eleventy-eleventh email registration app for Django.But this one does not feed your cat.UsageThis example assumes you are using a recent version of Django, jQuery and
Twitter Bootstrap.Installdjango-email-registrationusing pip.Copy this code somewhere on your login or registration page:<h2>{% trans "Send an activation link" %}</h2>
<form method="post" action="{% url "email_registration_form" %}"
    class="well" id="registration">
  {% csrf_token %}
  <div class="controls">
    <input id="id_email" type="text" name="email" maxlength="30"
      placeholder="{% trans "Email address" %}">
  </div>
  <button type="submit" class="btn btn-primary">
    {% trans "Register" %}</button>
</form>

<script>
function init_registration($) {
  $('#registration').on('submit', function() {
    var $form = $(this);
    $.post(this.action, $form.serialize(), function(data) {
      $('#registration').replaceWith(data);
      init_registration($);
    });
    return false;
  });
}
$(init_registration);
</script>(Alternatively, include the template snippetregistration/email_registration_include.htmlsomewhere.)Addemail_registrationtoINSTALLED_APPSand includeemail_registration.urlssomewhere in your URLconf.Make sure that Django is able tosend emails.Presto.
Package: django-email-relay
django-email-relaydjango-email-relayenables Django projects without direct access to a preferred SMTP server to use that server for email dispatch.It consists of two parts:A Django app with a custom email backend that stores emails in a central database queue. This is what you will use on all the distributed Django projects that you would like to give access to the preferred SMTP server.A relay service that reads from this queue to orchestrate email sending. It is available as either a standalone Docker image or a management command to be used within a Django project that does have access to the preferred SMTP server.Getting StartedVisit thedocumentationfor more information. There you will find:Whywe created this package and how it can help you.How toinstallandconfigurethe relay service and Django app.How tousethe Django app to send emails.Things to be aware of when it comes time toupdatethe package.How you cancontributeto the package.Licensedjango-email-relayis licensed under the MIT license. See theLICENSEfile for more information.InspirationThis package is heavily inspired by thedjango-mailerpackage.django-maileris licensed under the MIT license, which is also the license used for this package. The required copyright notice is included in theLICENSEfile for this package.