Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
79b4932
Unit Test refactoring.
aaloy Jan 12, 2013
7384b6b
added from_address field
aaloy Jan 14, 2013
57d8bcc
Demo app to test mailing.
aaloy Jan 22, 2013
91da78e
Updated README to add the testing mail server.
aaloy Feb 2, 2013
d84a6a5
remove uneed configuration
aaloy Feb 9, 2013
d56025a
integration with https://github.com/selwin/django-mailer/tree/cleanup…
aaloy Feb 23, 2013
714bea8
Test command
aaloy Feb 23, 2013
8e2a8a7
Added bin cron samples. Merged documentation.
aaloy Feb 23, 2013
2149838
updated version number
aaloy Feb 23, 2013
7e4f88d
Created a basic mail viewer for the demo applications. Allows you to
aaloy Feb 24, 2013
b196d2e
Convert html display in a iframe to avoid possible clashes between page
aaloy Feb 24, 2013
a9ff561
demo requirements
aaloy Feb 24, 2013
f296168
Merge branch 'master' of https://github.com/APSL/django-mailer-2
aaloy Feb 24, 2013
b66a6e4
Updated requirements
aaloy Feb 24, 2013
fac30e7
Docs ad minor changes on template
aaloy Feb 24, 2013
0274684
Create sphinx doc to move to readthedocs
aaloy Feb 24, 2013
9532744
added readthedocs link
aaloy Feb 24, 2013
7f5031b
Changed code to allow access to mails to just superuser users
aaloy Feb 25, 2013
22e92c1
Explains history
aaloy Mar 1, 2013
7857bea
bug on setup
aaloy Mar 7, 2013
facb18f
Now we can show e-mail in the admin
aaloy Mar 14, 2013
838cf4b
added requirements
aaloy Mar 14, 2013
74655a3
Upgraded version number
aaloy Mar 15, 2013
cdc9427
Added dependencies
aaloy Mar 19, 2013
a05e53c
django 1.5 compatibility
aaloy May 13, 2013
a7eb344
added from future in templates
aaloy May 15, 2013
b8fc7dc
corrijo admin para funciona con 1.3
aaloy Jun 4, 2013
a9a4d86
Merge branch 'master' of http://github.com/APSL/django-mailer-2
aaloy Jun 4, 2013
49853e9
Added a management commant to allow monitoring
aaloy Feb 1, 2014
6e5a63a
Merge branch 'master' of github.com:APSL/django-mailer-2
aaloy Feb 1, 2014
f9cfc34
Added unit test to theck the status_mail command and see it honours t…
aaloy Feb 1, 2014
44acd31
Modified to have a better look
aaloy Feb 1, 2014
cbf50a6
Modified the template so the show button is only displayed in the mai…
aaloy Feb 10, 2014
bedcc0a
Added a direct link in message list to show a message
aaloy Feb 18, 2014
ed8cd88
Merge con master
francescarpi Apr 16, 2014
c6086c8
Había un conflicto. Resulto
francescarpi Apr 16, 2014
c330314
Activo fancybox para los enlaces de 'show' que se muestran en los lis…
francescarpi Apr 22, 2014
184cefb
Add templates dir in MANIFEST.in
sastred Oct 24, 2014
e5e56d9
Added include_package_data=True to setup.py
sastred Oct 24, 2014
1837c9a
The ability to run tests on django 1.7
mjtorn Nov 17, 2014
c259415
Use timezone.now() where available
mjtorn Nov 17, 2014
f494cb8
Ampliamos ancho de iframe
francescarpi Nov 19, 2014
c2e269d
Merge pull request #2 from mjtorn/modern-django
aaloy Feb 27, 2015
b72826f
Remove forcing DEBUG logging devel
bercab Jul 13, 2015
0650d30
Update __init__.py
Nov 12, 2015
3a700d0
Merge pull request #4 from mikkki/patch-1
sastred Nov 13, 2015
594b3fb
Add not maintained warning
sastred Nov 13, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.pyc

_*
/django_mailer_2.egg-info/dependency_links.txt
/django_mailer_2.egg-info/PKG-INFO
/django_mailer_2.egg-info/SOURCES.txt
/django_mailer_2.egg-info/top_level.txt
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include LICENSE
recursive-include docs *
recursive-include django_mailer/templates *
14 changes: 12 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
django-mailer-2 by Chris Beaven (a fork of James Tauber's django-mailer)
WARNING: This fork is no longer maintained, use https://github.com/APSL/django-yubin.

A reusable Django app for queuing the sending of email
django-mailer-2 by APSL is a Chris Beaven form from a fork of
James Tauber's django-mailer.

A reusable Django app for queuing the sending of email.

Execute runtests.py to run the test. You'll need a working mail server
or just

python -m smtpd -n -c DebuggingServer localhost:1025

Find documentation about configuration an use on: https://django-mailer2.readthedocs.org/en/latest/
13 changes: 13 additions & 0 deletions bin/cleanup_mail
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# cron job example to run cleanup_mail and delete old mails
# replace {{username}} with the user who is going to execute the task
# the sample assumes you have virtualenv and virtualenvwrapper installed
# and that the applicacion is installed in src

USER={{username}}
export WORKON_HOME=/$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
VIRTUALENV=$USER
workon $VIRTUALENV
cd $HOME/src
python manage.py cleanup_mail --days=90
4 changes: 4 additions & 0 deletions bin/fake-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
echo "Runing a fake smptp server on localhost:1020"

python -m smtpd -n -c DebuggingServer localhost:1025
13 changes: 13 additions & 0 deletions bin/retry_deferred
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# cron job example to run retry_deferred
# replace {{username}} with the user who is going to execute the task
# the sample assumes you have virtualenv and virtualenvwrapper installed
# and that the applicacion is installed in src

USER={{username}}
export WORKON_HOME=/$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
VIRTUALENV=$USER
workon $VIRTUALENV
cd $HOME/src
python manage.py retry_deferred
13 changes: 13 additions & 0 deletions bin/send_mails
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# replace {{username}} with the user who is going to execute the task
# the sample assumes you have virtualenv and virtualenvwrapper installed
# and that the applicacion is installed in src

USER={{usern{{username}}
export WORKON_HOME=/$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
VIRTUALENV=$USER

workon $VIRTUALENV
cd $HOME/src
python manage.py send_mail
Binary file added demo/demo.sqlite
Binary file not shown.
Empty file added demo/demo/__init__.py
Empty file.
Empty file.
Empty file.
25 changes: 25 additions & 0 deletions demo/demo/management/commands/testmail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python
# encoding: utf-8
# ----------------------------------------------------------------------------


from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.core.mail import send_mail

class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--quantity',
dest='qtt',
default=False,
help = 'Generates a number of fake mails for testing'
),
)

def handle(self, *args, **options):
number=int(options['qtt'])
for i in range(0, number):
send_mail('test %s' %i , 'body %s' % i,
'[email protected]', ['recipient%[email protected]' %i, ])
self.stdout.write('Generated')

154 changes: 154 additions & 0 deletions demo/demo/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Django settings for demo project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', '[email protected]'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'demo.sqlite', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '&-8hi+rl5oi(_kenr3^q3+tw#rayvmzuiu*i70)ase+tok!(o7'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'demo.urls'

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'demo.wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'django_mailer',
'demo',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
EMAIL_BACKEND = 'django_mailer.smtp_queue.EmailBackend'
58 changes: 58 additions & 0 deletions demo/demo/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{% load static i18n %}{% load url from future %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# profile: http://ogp.me/ns/profile#">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="imagetoolbar" content="false" />
<title>{% block head_title_base %}{% block head_title %}{% endblock %} | {% trans "Project Name" %}{% endblock %}</title>
<link rel="shortcut icon" href="{% static "favicon.ico" %}" />
<meta name="description" content="{% block meta_description %}{% endblock %}">

{% block style_base %}
{% block extra_style %}{% endblock %}
{% endblock %}

{% block extra_head_base %}
{% block extra_head %}{% endblock %}
{% block analytics %}
{% endblock analytics %}
{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}"
{% block body_attrs %}{% endblock %}
id="{% block body_id %}{% endblock %}">
<div class="container">
{% block topbar_base %}
{% endblock %}

<div class="container">
{% block ieprompt %}{% endblock %}
<div id="loading" class="loader" style="display: none;">{% trans "Loading" %}…</div>

{% block page_header_base %}
{% block page_header %}{% endblock %}
{% endblock %}

<div class="row-fluid">
{% block content %}{% endblock %}
</div>
</div>

<div id="push"></div>{# sticky footer push #}
</div>{# /wrap #}

{% block footer_base %}
{% endblock %}

{% block script_base %}
{% block extra_script %}{% endblock %}
{% endblock %}

{% block extra_body_base %}
{% block extra_body %}{% endblock %}
{% endblock %}

{% block modal_base %}{% endblock %}
</body>
</html>
1 change: 1 addition & 0 deletions demo/demo/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "base.html" %}
13 changes: 13 additions & 0 deletions demo/demo/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from demo.views import IndexView

urlpatterns = patterns('',
# Examples:
url(r'^$', IndexView.as_view(), name='home'),
url(r'^admin/', include(admin.site.urls)),
)
8 changes: 8 additions & 0 deletions demo/demo/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8
# ----------------------------------------------------------------------------

from django.views.generic import TemplateView

class IndexView(TemplateView):
template_name = 'index.html'
28 changes: 28 additions & 0 deletions demo/demo/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
WSGI config for demo project.

This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.

Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.

"""
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
10 changes: 10 additions & 0 deletions demo/manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
3 changes: 3 additions & 0 deletions demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
django
pyzmail
#and django_mailer2 of course
Loading