Giter Site home page Giter Site logo

barseghyanartur / django-template-debug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from calebsmith/django-template-debug

0.0 3.0 0.0 326 KB

A small collection of template tags for debugging and introspecting templates

License: BSD 3-Clause "New" or "Revised" License

Python 98.74% HTML 1.26%

django-template-debug's Introduction

django-template-debug

A small collection of template tags for debugging and introspecting Django templates

Documentation

Requirements

None, but the latest ipdb is highly recommended.

Installation

django-template-debug is available on pypi, so the easiest way to install it is using pip:

pip install django-template-debug

Setup

Add 'template_debug' to the INSTALLED_APPS iterable in your settings file. For example:

INSTALLED_APPS = (
    ...
    'template_debug',
    ...
)

Add TEMPLATE_DEBUG = True to your local or development settings if it is not already set.

  • Unless TEMPLATE_DEBUG is set to True, the django-template-debug templates will return an empty string without doing anything. This behavior prevents your application from calling set_trace() or print in a production environment if django-template-debug template tags are accidentally commited and deployed.

Usage

Add {% load debug_tags %} in any Django template.

The available tags to use are {% set_trace %} {% variables %} {% attributes varname %} and {% details varname %}

See Example Usage docs for more details

Developer Setup

Create a fresh virtualenv and install the test requirements:

mkvirtualenv template-debug
pip install -r requirements/test.txt

Use manage.py in the project directory along with the example.settings file for local testing.

To run unittests using the virtualenv's Python and Django, use the runtests script. To test all supported versions of Python and Django, run the unittests using tox.

django-template-debug's People

Contributors

calebsmith avatar blueyed avatar stefanklug avatar kmmbvnr avatar

Watchers

James Cloos avatar Artur Barseghyan avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.