Metadata-Version: 2.1
Name: django-template-engines
Version: 0.0.4
Summary: Additional template engines for Django.
Home-page: https://github.com/Terralego/django-template-engines
Author: Makina Corpus
Author-email: terralego-pypi@makina-corpus.com
License: UNKNOWN
Description: [![Build Status](https://travis-ci.org/Terralego/django-template-engines.svg?branch=master)](https://travis-ci.org/Terralego/django-template-engines)
        [![Maintainability](https://api.codeclimate.com/v1/badges/2b6de132c98427007ab4/maintainability)](https://codeclimate.com/github/Terralego/django-template-engines/maintainability)
        [![codecov](https://codecov.io/gh/Terralego/django-template-engines/branch/master/graph/badge.svg)](https://codecov.io/gh/Terralego/django-template-engines)
        ![Python Version](https://img.shields.io/badge/python-%3E%3D%203.6-blue.svg)
        ![Django Version](https://img.shields.io/badge/django-%3E%3D%202.1-blue.svg)
        [![PyPI version](https://badge.fury.io/py/django-template-engines.svg)](https://badge.fury.io/py/django-template-engines)
        [![Documentation Status](https://readthedocs.org/projects/django-template-engines/badge/?version=latest)](https://django-template-engines.readthedocs.io/en/latest/?badge=latest)
        
        # django-template-engines
        
        ## Description
        
        Additional template engines for Django (ODT for now).
        
        ## How to use a specific template backend
        
        In the settings, add:
        
        ```
        INSTALLED_APPS = [
            ...
            'template_engines',
        ]
        
        ...
        
        TEMPLATES = [
            {
                'BACKEND': 'template_engines.backends.odt.OdtEngine',
                'DIRS': [
                ],
                'APP_DIRS': True,
            },
            {
                'BACKEND': 'django.template.backends.django.DjangoTemplates',
                'DIRS': [
                ],
                'APP_DIRS': True,
                'OPTIONS': {
                    'context_processors': [
                        'django.template.context_processors.debug',
                        'django.template.context_processors.request',
                        'django.contrib.auth.context_processors.auth',
                        'django.contrib.messages.context_processors.messages',
                    ],
                },
            },
        ]
        ```
        
        ## A view exemple
        
        ```
        from django.views.generic.detail import DetailView
        
        
        class TemplateView(DetailView):
            queryset = AModel.objects.all()
            template_engine = 'odt'
            content_type = 'application/vnd.oasis.opendocument.text'
        
            def get_context_data(self, **kwargs):
                context = super().get_context_data(**kwargs)
                context['image'] = {'content': open(path, 'rb').read()}
                return context
        ```
        
        
        # Versions
        
        ## 0.0.4
        
        * Abstract template engine for writing custom engines (`template_engines.backends.abstract.AbstractEngine`).
        * Abstract template class for writing custom template classes (`template_engines.backends.abstract.AbstractTemplate`).
        * Odt template engine (`template_engines.backends.odt.OdtEngine`).
        * Odt template class (`template_engines.backends.odt.OdtTemplate`).
        * A template tag to load images into an odt template (`odt_image_loader`).
        
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
