Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7071517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:41:50+00:00 2026-05-28T05:41:50+00:00

Does anyone know of an existing library for inspecting elements in the template? Currently

  • 0

Does anyone know of an existing library for inspecting elements in the template?

Currently I usually end up doing this in the view:

show_me = dir(the_deets_on_this_object)
raise ValueError()

Then I can inspect the value of show_me in the debugger stack trace.

However, this is really ugly. I’d love to be able to do this inspection in the template, like is done in php with the print_r

{% load development_show_me %}
{{the_deets_on_this_object|show_them_to_me}}

I know that this doesn’t exist in the django standard template library, but I’m hoping someone has already written this template filter so I can just happily use it.

Bonus behaviors:

  • Checks for settings.DEBUG and raises an error that isn’t trapped if it is false
  • wraps the output in < pre >

I’ll write it if I have to, but hopefully someone else has already done this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:41:50+00:00Added an answer on May 28, 2026 at 5:41 am

    In django there is much better than print_r:

    • if the template crashes, you have access to all variable in the debig template. you can force this by settings {% url fjkdslmjfdklmfjlsmqk %}
      It’s like a super print_r on all variables.

    • you can install django(extensions and werkzeug, this way you can replace runserver with runserver_plus and get the same page as the one we talked about, but with interactive Python shell embeded at every line of the stack trace

    • you can install django_template_repl, which will let you start the debugger at anyplace in the template, in the form of a python shell or a template shell.

    • you can install the django-debug-toolbar to get print_r style display and much more in a JS side bar invisible to anybody but you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to integrate this wordcount plugin with the existing django-ckeditor apps?
Does anyone know of existing software or algorithms to calculate a package size for
Does anyone know of existing code that lets you draw fully justified text in
Does anyone know of any existing packages or libraries that can be used to
Does anyone know of any existing projects that aim to port Android's Java VM
Does anyone know of an existing ruby implementation of a read/write lock - http://en.wikipedia.org/wiki/Readers-writer_lock
Does anyone know of an existing browser/OS useragent string grid? It's hard to test,
Does anyone know how to modify an existing import specification in Microsoft Access 2007
Does anyone know if its possible to create a new property on an existing
Does anyone know of any issues with VS 2003/2005 and 2008 co-existing on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.