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 5972123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:36:50+00:00 2026-05-22T20:36:50+00:00

I have a 500.html template which gets loaded whenever my app explodes but I

  • 0

I have a 500.html template which gets loaded whenever my app explodes but I wanted to know if there’s any way I can output the exception’s message in the template?

So if I do this:

raise Exception("You broke it!")

This will load 500.html when the DEBUG flag is set to True but how can I access the exception message in the template? Something like:

{{ exception.message }}

Many thanks.

G

  • 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-22T20:36:51+00:00Added an answer on May 22, 2026 at 8:36 pm

    Have a look at this answer:

    How do I include a stacktrace in my Django 500.html page?

    It’s not good to pass the exception to your template/user as it might show some inside workings that you don’t want available to the outside, but if you really need to, you could write your own 500 view, grabbing the exception and passing it to your 500 template

    views.py

    def custom_500(request):
        t = loader.get_template('500.html')
        type, value, tb = sys.exc_info(),
        return HttpResponseServerError(t.render(Context({
        'exception_value': value,
    })))
    

    somewhere in urls.py

    handler500 = 'mysite.views.my_custom_error_view'
    

    template

    {{ exception_value }}
    

    more about it here: https://docs.djangoproject.com/en/1.6/topics/http/views/#the-500-server-error-view

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

Sidebar

Related Questions

Is there a way to upload an app, but only have it accessible by
I have this html content, there are 500 tables like this in the page.
I have a simple HTML Table (10 columns x 500 rows). When the page
I have created a template for the 500 HTTP error. I have inserted my
I have html table with about 30 columns and somewhere between 10 to 500
I have problem with using template in Google App Engine by Python. the thing
I have a HTML page where there are many <a onclick=javascript> What i need
I have a page which uses a tag template. My web.xml is very basic.
I have a HTML list of about 500 items and a filter box above
i have 500 records in a table. one column holds all html data. so

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.