{ "info": { "author": "Fantomas42", "author_email": "fantomas42@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=========================\nEmencia Django Newsletter\n=========================\n\nThe problematic was :\n\n *How to couple a contact base to a mailing list and sending newsletters throught Django ?*\n\nImagine that we have an application containing some kind of profiles or something like the **django.contrib.auth** and you want to send newsletters to them and tracking the activity.\n\n.. contents::\n\nFeatures\n========\n\nMore than a long speech, here the list of the main features :\n\n * Coupling capacities with another django model.\n * Variables can be used in the newsletter's templates.\n * Mailing list managements (merging, importing...).\n * Import/Export of the contact in VCard 3.0.\n * Configurable SMTP servers with flow limit management.\n * Working groups.\n * Can send newsletter previews.\n * Subscriptions and unsubscriptions to mailing list.\n * Attachments in newsletters.\n * Unique urls for an user.\n * Tracking statistics.\n\n\nArchitecture\n============\n\nAt the level of the application architecture, we can see 2 originalities who need to be explained.\n\nContent types\n-------------\n\nThe **content types** application is used to link any *Contact* model instance to another model instance.\nThis allow you to create different kinds of contact linked to differents application, and retrieve the association at anytime.\n\nThis is particulary usefull with the templates variables if certain informations are located in the model instance linked.\n\nCronjob/Command\n---------------\n\nThe emencia.django.newsletter application will never send the newsletters registered in the site until you launch the **send_newsletter** command. ::\n\n $ python manage.py send_newsletter\n\nThis command will launch the newsletters who need to be launched accordingly to the credits of the SMTP server of the newsletter.\nThat's mean that not all newsletters will be expedied at the end of the command because if you use a public SMTP server you can be banished temporarly if you reach the sending limit.\nTo avoid banishment all the newsletters are not sended in the same time and immediately.\n\nSo it is recommanded to create a **cronjob** for launching this command every hours for example.\n\nInstallation\n============\n\nYou could retrieve the last sources from http://github.com/Fantomas42/emencia-django-newsletter and running the installation script ::\n\n $ python setup.py install\n\nor use pip ::\n\n $ pip install -e git://github.com/Fantomas42/emencia-django-newsletter.git#egg=emencia.django.newsletter\n\nFor the latest stable version use easy_install ::\n\n $ easy_install emencia.django.newsletter\n\nApplications\n------------\n\nThen register **emencia.django.newsletter**, **admin**, **contenttypes** and **tagging** in the INSTALLED_APPS section of your project's settings. ::\n\n INSTALLED_APPS = (\n # Your favorites apps\n 'django.contrib.contenttypes',\n 'django.contrib.admin',\n 'tagging',\n 'emencia.django.newsletter',)\n\n\nTemplate Context Processors\n---------------------------\n\nAdd these following template context processors if not already present. ::\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n 'django.core.context_processors.auth',\n 'django.core.context_processors.i18n',\n 'django.core.context_processors.request',\n 'django.core.context_processors.media',\n 'emencia.django.newsletter.context_processors.media',)\n\nUrls\n----\n\nIn your project urls.py adding this following line to include the newsletter's urls for serving the newsletters in HTML. ::\n\n url(r'^newsletters/', include('emencia.django.newsletter.urls')),\n\nNote this urlset is provided for convenient usage, but you can do something like that if you want to customize your urls : ::\n\n url(r'^newsletters/', include('emencia.django.newsletter.urls.newsletter')),\n url(r'^mailing/', include('emencia.django.newsletter.urls.mailing_list')),\n url(r'^tracking/', include('emencia.django.newsletter.urls.tracking')),\n url(r'^statistics/', include('emencia.django.newsletter.urls.statistics')),\n\nMedia Files\n-----------\n\nYou have to make a symbolic link from emencia/django/newsletter/media/ directory to your media directory or make a copy named **edn**,\nbut if want to change this value, define NEWSLETTER_MEDIA_URL in the settings.py as appropriate.\n\nDon't forget to serve this url.\n\nSynchronization\n---------------\n\nNow you can run a *syncdb* for installing the models into your database.\n\n\nDBMS considerations\n===================\n\nIt's not recommended to use SQLite for production use. Because is limited to 999\nvariables into a SQL query, you can not create a Mailing List greater than this limitations\nin the Django's admin modules. Prefer MySQL ou PgSQL.\n\n\nHOWTO use TinyMCE for editing the newsletters\n=============================================\n\nIt can be usefull for the end user to have a WYSIWYG editor for the\ncreation of the newsletter. The choice of the WYSIWYG editor is free and\nthe described method can be applied for anything, but we will focus on\nTinyMCE because he has many features and a usefull plugin for loading\ntemplates within it.\n\nFirst of all install the `django-tinymce\n`_ application into your project.\n\nNow you will write a module called admin.py into the root directory of your\nproject. This module will override the NewsletterAdmin class provided by\nemencia.django.newsletter with the TinyMCE editor and register the\noverrided class into the admin site. ::\n\n from django import forms\n from django.contrib import admin\n\n from tinymce.widgets import TinyMCE\n from emencia.django.newsletter.models import Newsletter\n from emencia.django.newsletter.admin import NewsletterAdmin\n\n\n class NewsletterTinyMCEForm(forms.ModelForm):\n content = forms.CharField(widget=TinyMCE(attrs={'cols': 150, 'rows': 80}))\n\n class Meta:\n model = Newsletter\n\n class NewsletterTinyMCEAdmin(NewsletterAdmin):\n form = NewsletterTinyMCEForm\n\n admin.site.unregister(Newsletter)\n admin.site.register(Newsletter, NewsletterTinyMCEAdmin)\n\nThe last step is to make a call to your module to load the code. A good\nsolution is to import the admin.py module in the urls.py file of your\nproject. ::\n\n import yourproject.admin\n\nEnjoy !\n\n\nHOWTO couple your profile application with emencia.django.newsletter\n====================================================================\n\nIf you wan to quickly import your contacts into a mailing list for example,\nyou can write an admin's action for your model.\n\nWe suppose that we have the fields *email*, *first_name* and *last_name* in a models name **Profile**.\n\nIn his AdminModel definition add this method and register it into the *actions* property. ::\n\n class ProfileAdmin(admin.ModelAdmin):\n\n def make_mailing_list(self, request, queryset):\n from emencia.django.newsletter.models import Contact\n from emencia.django.newsletter.models import MailingList\n\n subscribers = []\n for profile in queryset:\n contact, created = Contact.objects.get_or_create(email=profile.mail,\n defaults={'first_name': profile.first_name,\n 'last_name': profile.last_name,\n 'content_object': profile})\n subscribers.append(contact)\n new_mailing = MailingList(name='New mailing list',\n description='New mailing list created from admin/profile')\n new_mailing.save()\n new_mailing.subscribers.add(*subscribers)\n new_mailing.save()\n self.message_user(request, '%s succesfully created.' % new_mailing)\n make_mailing_list.short_description = 'Create a mailing list'\n\n actions = ['make_mailing_list',]\n\nThis action will create or retrieve all the **Contact** instances needed for the mailing list creation.\n\nAfter this you can send a newsletter to this mailing list.\n\nDevelopment\n===========\n\nA `Buildout\n`_ script is provided to properly initialize the project\nfor anybody who wants to contribute.\n\nFirst of all, please use `VirtualEnv\n`_ to protect your system.\n\nFollow these steps to start the development : ::\n\n $ git clone git://github.com/Fantomas42/emencia-django-newsletter.git\n $ virtualenv --no-site-packages emencia-django-newsletter\n $ cd emencia-django-newsletter\n $ source ./bin/activate\n $ python bootstrap.py\n $ ./bin/buildout\n\nThe buildout script will resolve all the dependancies needed to develop the application.\n\nOnce these operations are done, you are ready to develop on the project.\n\nRun this command to launch the tests. ::\n\n $ ./bin/test\n\nPretty easy no ?\n\nDatabase Representation\n=======================\n\n.. image:: https://github.com/Fantomas42/emencia-django-newsletter/raw/master/docs/graph_model.png\n\n\nChangelog\n=========\n\n0.1dev (unreleased)\n-------------------\n\n- Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://emencia.fr", "keywords": "django,newsletter,mailing", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "emencia.django.newsletter", "package_url": "https://pypi.org/project/emencia.django.newsletter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/emencia.django.newsletter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://emencia.fr" }, "release_url": "https://pypi.org/project/emencia.django.newsletter/0.2/", "requires_dist": null, "requires_python": null, "summary": "A Django app for sending newsletter by email to a contact list.", "version": "0.2" }, "last_serial": 738937, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ce90c6b3db58b3bdc24780f85e87747a", "sha256": "3dc8e995e4a1a9e4f3265b9810b44b00c48c7662c7958bad216a8dd0a4336b1d" }, "downloads": -1, "filename": "emencia.django.newsletter-0.1.tar.gz", "has_sig": false, "md5_digest": "ce90c6b3db58b3bdc24780f85e87747a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 113998, "upload_time": "2009-11-09T10:56:08", "url": "https://files.pythonhosted.org/packages/6c/9a/10d6ab93f390ff4dc1ad9477bb4ac49de3b9d0b2da2780f6d00e8d75f65e/emencia.django.newsletter-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "6c2693d8b245bb8cb2d36b06a95160b1", "sha256": "759109fbe36b88eaf78c2d54ced89d9d174f1c0b434e81041c61a7f9fd0b7f53" }, "downloads": -1, "filename": "emencia.django.newsletter-0.2.tar.gz", "has_sig": false, "md5_digest": "6c2693d8b245bb8cb2d36b06a95160b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506632, "upload_time": "2011-01-14T17:13:17", "url": "https://files.pythonhosted.org/packages/fa/e1/3770331e8dac02c65f96d42be24f035b6e78557dc993c1b5304d12d37f8b/emencia.django.newsletter-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6c2693d8b245bb8cb2d36b06a95160b1", "sha256": "759109fbe36b88eaf78c2d54ced89d9d174f1c0b434e81041c61a7f9fd0b7f53" }, "downloads": -1, "filename": "emencia.django.newsletter-0.2.tar.gz", "has_sig": false, "md5_digest": "6c2693d8b245bb8cb2d36b06a95160b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 506632, "upload_time": "2011-01-14T17:13:17", "url": "https://files.pythonhosted.org/packages/fa/e1/3770331e8dac02c65f96d42be24f035b6e78557dc993c1b5304d12d37f8b/emencia.django.newsletter-0.2.tar.gz" } ] }