DRY up duplicate content in the readme and docs index page.

* Don't maintain similar overview in README.rst and docs/index.rst -- instead just include relevant portions of readme in the docs
* Patch up README version numbers and doc links in setup.py long_description to freeze them to the version being setup
* Suppress the Travis build status indicator in the docs and PyPI, since it can't be frozen to the specific version in question
This commit is contained in:
medmunds
2013-03-04 19:09:13 -08:00
parent 28538a5391
commit ea72b2d790
4 changed files with 146 additions and 90 deletions

View File

@@ -3,83 +3,20 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Djrill: Mandrill for Django
===========================
.. Incorporate the shared-intro section from the root README:
Release |release|
.. include:: ../README.rst
:start-after: _shared-intro:
:end-before: END shared-intro
Djrill integrates the `Mandrill <http://mandrill.com>`_ transactional
email service into Django.
.. Eliminate the README's Travis build status indicator.
(Is there some way we could link to Travis status for the
specific |VERSION| of the app being documented here???)
In general, Djrill "just works" with Django's built-in
`django.core.mail <https://docs.djangoproject.com/en/dev/topics/email/>`_
functions. It supports:
* HTML email, attachments, extra headers, and other basic email functionality
* Mandrill-specific extensions like tags, metadata, tracking, and MailChimp templates
* An optional Django admin interface
Djrill is tested with Django 1.3 and later (including Python 3 support with Django 1.5).
It is made available under the BSD license.
.. |buildstatus| replace:: \
.. _quickstart:
Quick Start
-----------
1. Install from PyPI:
.. code-block:: console
$ pip install djrill
2. Edit your project's :file:`settings.py`:
.. code-block:: python
INSTALLED_APPS = (
...
"djrill"
)
MANDRILL_API_KEY = "<your Mandrill key>"
EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend"
3. Now the regular `Django email functions <https://docs.djangoproject.com/en/dev/topics/email/>`_
will send through Mandrill::
from django.core.mail import send_mail
send_mail("It works!", "This will get sent through Mandrill",
"Djrill Sender <djrill@example.com>", ["to@example.com"])
You could send an HTML message, complete with custom Mandrill tags and metadata::
from django.core.mail import EmailMultiAlternatives
msg = EmailMultiAlternatives(
subject="Djrill Message",
body="This is the text email body",
from_email="Djrill Sender <djrill@example.com>",
to=["Recipient One <someone@example.com>", "another.person@example.com"],
headers={'Reply-To': "Service <support@example.com>"} # optional extra headers
)
msg.attach_alternative("<p>This is the HTML email body</p>", "text/html")
# Optional Mandrill-specific extensions:
msg.tags = ["one tag", "two tag", "red tag", "blue tag"]
msg.metadata = {'user_id': "8675309"}
# Send it:
msg.send()
(Be sure to use a ``from_email`` that's in one of your Mandrill approved sending
domains, or the message won't get sent.)
.. _toc:
Documentation
-------------
@@ -87,6 +24,7 @@ Documentation
.. toctree::
:maxdepth: 2
quickstart
installation
usage/sending_mail
usage/templates

9
docs/quickstart.rst Normal file
View File

@@ -0,0 +1,9 @@
Djrill 1-2-3
============
.. Quickstart is maintained in README.rst at the source root.
(Docs can include from the readme; the readme can't include anything.)
.. include:: ../README.rst
:start-after: _quickstart:
:end-before: END quickstart