diff --git a/.gitignore b/.gitignore index e847a9a..4393c1d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ django_mail_queue.egg-info/ .idea *.iml /build +.vagrant +Vagrantfile diff --git a/.travis.yml b/.travis.yml index e2681cb..2f542d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,35 +3,17 @@ language: python python: - "2.7" - "3.3" + - "3.4" env: - DJANGO_VERSION=Django==1.4.2 - - DJANGO_VERSION=Django==1.4.3 - - DJANGO_VERSION=Django==1.4.4 - - DJANGO_VERSION=Django==1.4.5 - - DJANGO_VERSION=Django==1.4.6 - - DJANGO_VERSION=Django==1.4.7 - - DJANGO_VERSION=Django==1.4.8 - - DJANGO_VERSION=Django==1.4.9 - - DJANGO_VERSION=Django==1.4.10 - DJANGO_VERSION=Django==1.5 - - DJANGO_VERSION=Django==1.5.1 - - DJANGO_VERSION=Django==1.5.2 - - DJANGO_VERSION=Django==1.5.3 - - DJANGO_VERSION=Django==1.5.4 - - DJANGO_VERSION=Django==1.5.5 - - DJANGO_VERSION=Django==1.5.6 - - DJANGO_VERSION=Django==1.5.7 - DJANGO_VERSION=Django==1.6 - - DJANGO_VERSION=Django==1.6.1 - - DJANGO_VERSION=Django==1.6.2 - - DJANGO_VERSION=Django==1.6.3 - - DJANGO_VERSION=Django==1.6.4 - - DJANGO_VERSION=Django==1.6.5 + - DJANGO_VERSION=Django==1.7 # command to install dependencies install: - - pip install --use-mirrors $DJANGO_VERSION + - pip install $DJANGO_VERSION # command to run tests @@ -42,38 +24,5 @@ matrix: exclude: - python: "3.3" env: DJANGO_VERSION=Django==1.4.2 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.3 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.4 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.5 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.6 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.7 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.8 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.9 - - python: "3.3" - env: DJANGO_VERSION=Django==1.4.10 - python: "3.4" env: DJANGO_VERSION=Django==1.4.2 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.3 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.4 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.5 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.6 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.7 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.8 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.9 - - python: "3.4" - env: DJANGO_VERSION=Django==1.4.10 - diff --git a/README.md b/README.md index d756510..6c929c1 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,21 @@ Django Mail Queue Mail Queue provides an easy and simple way to send email. Each email is saved and queued up either in real time or with Celery. As always, feedback, bugs, and suggestions are welcome. +Python 3 Users! +--------------- + +Django 1.7 is only supported on Python 2 at this point. There is an +outstanding bug in issue #47. If you use Python 3 with Django 1.7 DO NOT UPGRADE +to 2.2.0. + Installation ------------ pip install django-mail-queue We officially support the 3 latest versions of Django as best as possible. Currently this means -that we test and support Django 1.4, 1.5, and 1.6 on Python 2.7, 3.3, and 3.4 - +that we test and support Django 1.4.2 and greater on Python 2.7, 3.3, and 3.4 + Read me some docs ----------------- diff --git a/docs/source/conf.py b/docs/source/conf.py index 75a524d..164762f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -41,16 +41,16 @@ # General information about the project. project = u'Django Mail Queue' -copyright = u'2011 - 2013, Derek Stegelman' +copyright = u'2011 - 2014, Derek Stegelman' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '2.1.2' +version = '2.2.0' # The full version, including alpha/beta/rc tags. -release = '2.1.2' +release = '2.2.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 80d4e06..652c73e 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -10,10 +10,10 @@ Requirements Django Mail Queue requires:: python 2.7 or greater - south - django 1.4 or greater + south #If using Django < 1.7 + django 1.4.2 or greater -Django Mail Queue is tested against Python 2.7, 3.3 and Django 1.4, and 1.5. +Django Mail Queue is tested against Python 2.7, 3.3 and Django 1.4.2, 1.5, 1.6, and 1.7. Installation ------------ @@ -31,9 +31,9 @@ Open ``settings.py`` and add ``mailqueue`` to your ``INSTALLED_APPS``:: INSTALLED_APPS = ( 'mailqueue', - 'south', + 'south', # only needed for < 1.7 ) - + Cron Job (optional) diff --git a/example/example/settings.py b/example/example/settings.py index 5f2f679..092bab4 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -29,7 +29,7 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'demo.db', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': '', @@ -172,4 +172,4 @@ 'propagate': True, }, } -} \ No newline at end of file +} diff --git a/mailqueue/__init__.py b/mailqueue/__init__.py index 90f53f6..6807fe2 100644 --- a/mailqueue/__init__.py +++ b/mailqueue/__init__.py @@ -1,2 +1,3 @@ -VERSION = '2.1.2' +VERSION = '2.2.0' +default_app_config = 'mailqueue.apps.MailQueueConfig' diff --git a/mailqueue/apps.py b/mailqueue/apps.py new file mode 100644 index 0000000..5c2c572 --- /dev/null +++ b/mailqueue/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + + +class MailQueueConfig(AppConfig): + name = 'mailqueue' + label = 'mailqueue' + verbose_name = "Mail Queue" diff --git a/mailqueue/migrations/0001_initial.py b/mailqueue/migrations/0001_initial.py index b501fde..436b0ee 100644 --- a/mailqueue/migrations/0001_initial.py +++ b/mailqueue/migrations/0001_initial.py @@ -1,43 +1,51 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +# -*- coding: utf-8 -*- +from __future__ import unicode_literals -class Migration(SchemaMigration): +from django.db import models, migrations - def forwards(self, orm): - - # Adding model 'MailerMessage' - db.create_table('mailqueue_mailermessage', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('subject', self.gf('django.db.models.fields.CharField')(max_length=250, null=True, blank=True)), - ('to_address', self.gf('django.db.models.fields.EmailField')(max_length=250)), - ('from_address', self.gf('django.db.models.fields.EmailField')(max_length=250)), - ('content', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('app', self.gf('django.db.models.fields.CharField')(max_length=250, null=True, blank=True)), - ('sent', self.gf('django.db.models.fields.BooleanField')(default=False)), - )) - db.send_create_signal('mailqueue', ['MailerMessage']) +class Migration(migrations.Migration): - def backwards(self, orm): - - # Deleting model 'MailerMessage' - db.delete_table('mailqueue_mailermessage') + dependencies = [ + ] - - models = { - 'mailqueue.mailermessage': { - 'Meta': {'object_name': 'MailerMessage'}, - 'app': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), - 'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'from_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'subject': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), - 'to_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'}) - } - } - - complete_apps = ['mailqueue'] + operations = [ + migrations.CreateModel( + name='Attachment', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('file_attachment', models.FileField(null=True, upload_to=b'mail-queue/attachments', blank=True)), + ], + options={ + 'verbose_name': 'Attachment', + 'verbose_name_plural': 'Attachments', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='MailerMessage', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('subject', models.CharField(max_length=250, verbose_name='Subject', blank=True)), + ('to_address', models.TextField(verbose_name='To')), + ('bcc_address', models.TextField(verbose_name='BCC', blank=True)), + ('from_address', models.EmailField(max_length=250, verbose_name='From')), + ('content', models.TextField(verbose_name='Content', blank=True)), + ('html_content', models.TextField(verbose_name='HTML Content', blank=True)), + ('app', models.CharField(max_length=250, verbose_name='App', blank=True)), + ('sent', models.BooleanField(default=False, verbose_name='Sent', editable=False)), + ('last_attempt', models.DateTimeField(verbose_name='Last attempt', null=True, editable=False, blank=True)), + ], + options={ + 'verbose_name': 'Message', + 'verbose_name_plural': 'Messages', + }, + bases=(models.Model,), + ), + migrations.AddField( + model_name='attachment', + name='email', + field=models.ForeignKey(blank=True, to='mailqueue.MailerMessage', null=True), + preserve_default=True, + ), + ] diff --git a/mailqueue/south_migrations/0001_initial.py b/mailqueue/south_migrations/0001_initial.py new file mode 100644 index 0000000..b501fde --- /dev/null +++ b/mailqueue/south_migrations/0001_initial.py @@ -0,0 +1,43 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding model 'MailerMessage' + db.create_table('mailqueue_mailermessage', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('subject', self.gf('django.db.models.fields.CharField')(max_length=250, null=True, blank=True)), + ('to_address', self.gf('django.db.models.fields.EmailField')(max_length=250)), + ('from_address', self.gf('django.db.models.fields.EmailField')(max_length=250)), + ('content', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + ('app', self.gf('django.db.models.fields.CharField')(max_length=250, null=True, blank=True)), + ('sent', self.gf('django.db.models.fields.BooleanField')(default=False)), + )) + db.send_create_signal('mailqueue', ['MailerMessage']) + + + def backwards(self, orm): + + # Deleting model 'MailerMessage' + db.delete_table('mailqueue_mailermessage') + + + models = { + 'mailqueue.mailermessage': { + 'Meta': {'object_name': 'MailerMessage'}, + 'app': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'from_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'subject': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), + 'to_address': ('django.db.models.fields.EmailField', [], {'max_length': '250'}) + } + } + + complete_apps = ['mailqueue'] diff --git a/mailqueue/migrations/0002_auto__add_field_mailermessage_html_content.py b/mailqueue/south_migrations/0002_auto__add_field_mailermessage_html_content.py similarity index 100% rename from mailqueue/migrations/0002_auto__add_field_mailermessage_html_content.py rename to mailqueue/south_migrations/0002_auto__add_field_mailermessage_html_content.py diff --git a/mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py b/mailqueue/south_migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py similarity index 100% rename from mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py rename to mailqueue/south_migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py diff --git a/mailqueue/migrations/0004_auto__add_attachment.py b/mailqueue/south_migrations/0004_auto__add_attachment.py similarity index 100% rename from mailqueue/migrations/0004_auto__add_attachment.py rename to mailqueue/south_migrations/0004_auto__add_attachment.py diff --git a/mailqueue/migrations/0005_auto__chg_field_mailermessage_html_content__chg_field_mailermessage_ap.py b/mailqueue/south_migrations/0005_auto__chg_field_mailermessage_html_content__chg_field_mailermessage_ap.py similarity index 100% rename from mailqueue/migrations/0005_auto__chg_field_mailermessage_html_content__chg_field_mailermessage_ap.py rename to mailqueue/south_migrations/0005_auto__chg_field_mailermessage_html_content__chg_field_mailermessage_ap.py diff --git a/mailqueue/migrations/0006_auto__chg_field_mailermessage_to_address__chg_field_mailermessage_bcc_.py b/mailqueue/south_migrations/0006_auto__chg_field_mailermessage_to_address__chg_field_mailermessage_bcc_.py similarity index 100% rename from mailqueue/migrations/0006_auto__chg_field_mailermessage_to_address__chg_field_mailermessage_bcc_.py rename to mailqueue/south_migrations/0006_auto__chg_field_mailermessage_to_address__chg_field_mailermessage_bcc_.py diff --git a/mailqueue/south_migrations/__init__.py b/mailqueue/south_migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/runtests.py b/runtests.py index 294c5be..6a6689f 100755 --- a/runtests.py +++ b/runtests.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -__author__ = 'derek' import os, sys from django.conf import settings import django @@ -39,7 +38,11 @@ USE_TZ=True) - +try: + # Django 1.7 needs this, but other versions dont. + django.setup() +except AttributeError: + pass from django.test.simple import DjangoTestSuiteRunner test_runner = DjangoTestSuiteRunner(verbosity=1)