Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Django template fragment

Project Description

Django-Box is a new way for fragmenting template in Django, Django-Box will load a template fragment that called in used template or base template. It provides a ‘box’ django inclusion tag, where every box can has its own separate function. The main view doesn’t have to provide data for every fragment, the data will be populate in its own function (fragmenting)


  1. Install using pip:

    pip install django_box

    or via github:

    pip install -r git+
  2. In your settings add the following:

    BOX_MODULE_PATH   = 'frontend'
  3. Create python package for your box controller same as BOX_MODULE_PATH

  4. Create template directory same as BOX_TEMPLATE_PATH


  1. Add box template tag in template (whether it is in regular template or base template)

    <h1>This is box fragment</h1>
    <p>{% box 'fragment1' %}</p>
  2. Create a in BOX_MODULE_PATH location, and create a class with same name of that fragment with Box class as it parent

    from django_box import Box
    class fragment1(Box):
        template_name = 'fragment1.html'
  3. Create a file in BOX_TEMPLATE_PATH within template directory with name same as template_name

Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_box-0.1.0.tar.gz (2.7 kB) Copy SHA256 Checksum SHA256 Source Dec 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting