====================================
Django apptemplates |latest-version|
====================================
|build-status| |health| |python-support| |license|
django-apptemplates is a Django template loader that allows you to load a
template from a specific application. By this you can both extend and
override a template at the same time. The default Django loaders require
you to copy the entire template you want to override, even if you only
want to override one small block.
Based on: http://djangosnippets.org/snippets/1376/
.. |latest-version| image:: https://img.shields.io/pypi/v/django-apptemplates.svg
:alt: Latest version on PyPI
:target: https://pypi.python.org/pypi/django-apptemplates
.. |build-status| image:: https://img.shields.io/travis/bittner/django-apptemplates/master.svg
:alt: Build status
:target: https://travis-ci.org/bittner/django-apptemplates
.. |health| image:: https://img.shields.io/codacy/grade/a9be2f4c385545e381c3a317f52782c5/master.svg
:target: https://www.codacy.com/app/bittner/django-apptemplates
:alt: Code health
.. |python-support| image:: https://img.shields.io/pypi/pyversions/django-apptemplates.svg
:target: https://pypi.python.org/pypi/django-apptemplates
:alt: Python versions
.. |license| image:: https://img.shields.io/pypi/l/django-apptemplates.svg
:alt: Software license
:target: https://github.com/bittner/django-apptemplates/blob/master/LICENSE.txt
Version Support
===============
django-apptemplates is `tested against`_ the officially supported combinations
of Python and Django, since Django 1.4 (Django 1.4 to 3.0 on Python 2.7, and
3.4 to 3.8).
.. _tested against: https://travis-ci.org/bittner/django-apptemplates
Installation, Setup and Use
===========================
This package is available from PyPI_. To install it simply execute:
.. code-block:: bash
$ pip install django-apptemplates
.. _PyPI: https://pypi.python.org/pypi/django-apptemplates
Settings (for Django 1.8+)
--------------------------
.. code-block:: python
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'loaders': [
'apptemplates.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
},
},
]
Settings (for Django < 1.8)
---------------------------
.. code-block:: python
TEMPLATE_LOADERS = (
'apptemplates.Loader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
How to Use in Templates
-----------------------
Template usage example (extend and override Django admin base template):
.. code-block:: python
{% extends "admin:admin/base.html" %}
The part before the colon (``:``) is called the Django app *namespace*.
Alternatives
============
* django-app-namespace-template-loader_ (supports empty namespaces)
.. _django-app-namespace-template-loader:
https://pypi.python.org/pypi/django-app-namespace-template-loader
Authors and Maintainers
=======================
* `Peter Bittner`_ (current maintainer)
* `Tomas Zulberti`_ (former maintainer)
* `Konrad Wojas`_ (original author)
.. _Peter Bittner: https://bitbucket.org/bittner/django-apptemplates
.. _Tomas Zulberti: https://bitbucket.org/tzulberti/django-apptemplates
.. _Konrad Wojas: https://bitbucket.org/wojas/django-apptemplates
Change Log
==========
(unreleased)
------------
* Drop support for Django 1.7 (ImportError)
* Drop support for Python 2.6, 3.2, 3.3 (not available on Travis CI)
1.4
---
* Fix Origin missing loader and template_name attrs -- Thanks Brendan Roy,
@bmon, and Matthew Somerville, @dracos!
* Also test against Django 2.0
1.3
---
* Add template loader to returned Origins -- Thanks J.J., @jdotjdot!
* Also test against Python 3.6 -- Thanks Justin Walgran, @jwalgran!
1.2
---
* Reestablish support for Django 1.4 through 1.8 (broken since version 1.1)
* Add tests for template rendering
* Drop support for Django 1.3 (which cannot be confirmed by tests)
* Drop support for Python 2.4 and 2.5 (which cannot be tested anymore)
1.1.1
-----
* Fix ``ImportError`` for Django 1.8 (broken in release 1.1)
* Add integration tests (test import of package across supported versions)
* Add ``clean`` and ``test`` commands to ``setup.py``
1.1
---
* Use ``django.template.Origin`` in computation of template location for Django
1.9 compatibility. -- Thanks, `Gilles Crettenand <https://bitbucket.org/krtek/>`_!
1.0
---
* Remove Django 1.9 deprecation warning of imports
* Update README with instructions for Django 1.8+
0.2
---
*Skipped to fix conflicting versioning in setup.py and the PyPI package*
0.0.1
-----
* Released as originally published on djangosnippets
Raw data
{
"_id": null,
"home_page": "https://github.com/bittner/django-apptemplates",
"name": "django-apptemplates",
"maintainer": "Peter Bittner",
"docs_url": null,
"requires_python": "",
"maintainer_email": "django@bittner.it",
"keywords": "django,template,loader",
"author": "Konrad Wojas",
"author_email": "bitbucket@m.wojas.nl",
"download_url": "https://files.pythonhosted.org/packages/b4/09/c1ba396458b478dd0266f92595e6bf939684097c25b5ceea87a103bc7c40/django-apptemplates-1.5.tar.gz",
"platform": "",
"description": "====================================\nDjango apptemplates |latest-version|\n====================================\n\n|build-status| |health| |python-support| |license|\n\ndjango-apptemplates is a Django template loader that allows you to load a\ntemplate from a specific application. By this you can both extend and\noverride a template at the same time. The default Django loaders require\nyou to copy the entire template you want to override, even if you only\nwant to override one small block.\n\nBased on: http://djangosnippets.org/snippets/1376/\n\n\n.. |latest-version| image:: https://img.shields.io/pypi/v/django-apptemplates.svg\n :alt: Latest version on PyPI\n :target: https://pypi.python.org/pypi/django-apptemplates\n.. |build-status| image:: https://img.shields.io/travis/bittner/django-apptemplates/master.svg\n :alt: Build status\n :target: https://travis-ci.org/bittner/django-apptemplates\n.. |health| image:: https://img.shields.io/codacy/grade/a9be2f4c385545e381c3a317f52782c5/master.svg\n :target: https://www.codacy.com/app/bittner/django-apptemplates\n :alt: Code health\n.. |python-support| image:: https://img.shields.io/pypi/pyversions/django-apptemplates.svg\n :target: https://pypi.python.org/pypi/django-apptemplates\n :alt: Python versions\n.. |license| image:: https://img.shields.io/pypi/l/django-apptemplates.svg\n :alt: Software license\n :target: https://github.com/bittner/django-apptemplates/blob/master/LICENSE.txt\n\nVersion Support\n===============\n\ndjango-apptemplates is `tested against`_ the officially supported combinations\nof Python and Django, since Django 1.4 (Django 1.4 to 3.0 on Python 2.7, and\n3.4 to 3.8).\n\n\n.. _tested against: https://travis-ci.org/bittner/django-apptemplates\n\nInstallation, Setup and Use\n===========================\n\nThis package is available from PyPI_. To install it simply execute:\n\n.. code-block:: bash\n\n $ pip install django-apptemplates\n\n\n.. _PyPI: https://pypi.python.org/pypi/django-apptemplates\n\nSettings (for Django 1.8+)\n--------------------------\n\n.. code-block:: python\n\n TEMPLATES = [\n {\n 'BACKEND': 'django.template.backends.django.DjangoTemplates',\n 'OPTIONS': {\n 'loaders': [\n 'apptemplates.Loader',\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n ],\n },\n },\n ]\n\nSettings (for Django < 1.8)\n---------------------------\n\n.. code-block:: python\n\n TEMPLATE_LOADERS = (\n 'apptemplates.Loader',\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n )\n\nHow to Use in Templates\n-----------------------\n\nTemplate usage example (extend and override Django admin base template):\n\n.. code-block:: python\n\n {% extends \"admin:admin/base.html\" %}\n\nThe part before the colon (``:``) is called the Django app *namespace*.\n\nAlternatives\n============\n\n* django-app-namespace-template-loader_ (supports empty namespaces)\n\n\n.. _django-app-namespace-template-loader:\n https://pypi.python.org/pypi/django-app-namespace-template-loader\n\nAuthors and Maintainers\n=======================\n\n* `Peter Bittner`_ (current maintainer)\n* `Tomas Zulberti`_ (former maintainer)\n* `Konrad Wojas`_ (original author)\n\n\n.. _Peter Bittner: https://bitbucket.org/bittner/django-apptemplates\n.. _Tomas Zulberti: https://bitbucket.org/tzulberti/django-apptemplates\n.. _Konrad Wojas: https://bitbucket.org/wojas/django-apptemplates\n\nChange Log\n==========\n\n(unreleased)\n------------\n\n* Drop support for Django 1.7 (ImportError)\n* Drop support for Python 2.6, 3.2, 3.3 (not available on Travis CI)\n\n1.4\n---\n\n* Fix Origin missing loader and template_name attrs -- Thanks Brendan Roy,\n @bmon, and Matthew Somerville, @dracos!\n* Also test against Django 2.0\n\n1.3\n---\n\n* Add template loader to returned Origins -- Thanks J.J., @jdotjdot!\n* Also test against Python 3.6 -- Thanks Justin Walgran, @jwalgran!\n\n1.2\n---\n\n* Reestablish support for Django 1.4 through 1.8 (broken since version 1.1)\n* Add tests for template rendering\n* Drop support for Django 1.3 (which cannot be confirmed by tests)\n* Drop support for Python 2.4 and 2.5 (which cannot be tested anymore)\n\n1.1.1\n-----\n\n* Fix ``ImportError`` for Django 1.8 (broken in release 1.1)\n* Add integration tests (test import of package across supported versions)\n* Add ``clean`` and ``test`` commands to ``setup.py``\n\n1.1\n---\n\n* Use ``django.template.Origin`` in computation of template location for Django\n 1.9 compatibility. -- Thanks, `Gilles Crettenand <https://bitbucket.org/krtek/>`_!\n\n1.0\n---\n\n* Remove Django 1.9 deprecation warning of imports\n* Update README with instructions for Django 1.8+\n\n0.2\n---\n\n*Skipped to fix conflicting versioning in setup.py and the PyPI package*\n\n0.0.1\n-----\n\n* Released as originally published on djangosnippets\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Django template loader that allows you to load and override a template from a specific Django application.",
"version": "1.5",
"split_keywords": [
"django",
"template",
"loader"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "0f55e832b9ec532cf7158fddf5bda9c6",
"sha256": "5631affc850a41f31fbc723473988a341d0260fe09d3c268d31633405c347f36"
},
"downloads": -1,
"filename": "django_apptemplates-1.5-py2-none-any.whl",
"has_sig": false,
"md5_digest": "0f55e832b9ec532cf7158fddf5bda9c6",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": null,
"size": 8450,
"upload_time": "2020-03-11T00:24:06",
"upload_time_iso_8601": "2020-03-11T00:24:06.860276Z",
"url": "https://files.pythonhosted.org/packages/e0/52/06d264e06bef7df745ac772a90e598360b02548337ca43338e01ba5a04bf/django_apptemplates-1.5-py2-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "47d686723e3473dfe1cfd1feef4c5ac6",
"sha256": "c2c46afd3d90827c1d821f137d59e430cb203649aa275b9c2763c871d7545d3f"
},
"downloads": -1,
"filename": "django-apptemplates-1.5.tar.gz",
"has_sig": false,
"md5_digest": "47d686723e3473dfe1cfd1feef4c5ac6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5144,
"upload_time": "2020-03-11T00:24:08",
"upload_time_iso_8601": "2020-03-11T00:24:08.599899Z",
"url": "https://files.pythonhosted.org/packages/b4/09/c1ba396458b478dd0266f92595e6bf939684097c25b5ceea87a103bc7c40/django-apptemplates-1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-03-11 00:24:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "bittner",
"github_project": "django-apptemplates",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "django-apptemplates"
}