Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-lime

How to install django-lime

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-lime
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
0.2 Available View build log
Linux (32-bit)
0.2 Available View build log
Linux (64-bit)
0.2 Available View build log
 
License
GPL 2.0/LGPL 2.1
Imports
Lastest release
version 0.2 on Jun 15th, 2013

Package

django-lime

Description

Easy sending of mixed content (html + plain) emails for Django.

Installation

  1. Install in your virtual environment:

    $ pip install django-lime

  2. Add lime to your INSTALLED_APPS of your Django settings module:

    >>> INSTALLED_APPS = (
    >>>     # ...
    >>>     'lime',
    >>>     # ...
    >>> )
    
  3. Copy the templates from lime to your main templates directory.

  4. Define LIME_SITE_LOGO and LIME_SITE_TEAM variables in your settings module.

  5. Make sure your django.contrib.sites.sites.models.Site has data that makes sense, as site_name and domain values will be taken from there. Alternatively, you can define (override) those by defining the following variables in your settings module.

    • LIME_SITE_NAME
    • LIME_SITE_DOMAIN

Usage examples

Inherit your app templates from lime base templates or your own copy of the lime templates (copied to templates directory). By default the following parameters are passed to your template:

  • site_name: Taken from your django.contrib.sites.models.Site.
  • domain: Taken from your django.contrib.sites.models.Site
  • site_team: Site team name.
  • site_logo: Relative URL to site logo.
>>> from lime import send_email
>>>
>>> send_email(
>>>     _("You've got mail"),
>>>     'ramzes.4@example.come', # From
>>>     'someone.else@example.com', # To
>>>     {
>>>         'date_submitted': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S"),
>>>         'url': 'http://example.com/check-this-fantastic-link.html',
>>>         'full_name': 'John Doe',
>>>         'from_name': 'Ramzes the 4th',
>>>     },
>>>     'foo/emails/foo_test.txt', # Text template
>>>     'foo/emails/foo_test.html' # HTML tempalte
>>> )

For a working example (including set-up Django environment) check the https://bitbucket.org/barseghyanartur/django-lime (example directory).

License

GPL 2.0/LGPL 2.1

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Subscribe to package updates

Last updated Jun 15th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.