1

I'm supplying a Django project to a client, who has requested a 'debugging' page that will show useful information.

[UPDATE for clarity: We'd like this page so we can use it for debugging in future: the clients are not very technical and I won't have direct access to their servers. In the event of future issues, it would be very useful if I could check out this page without asking them to edit the Debug setting or do any other server-side fiddling.]

The project will be running in production, so I can't set DEBUG=True.

What I would like is a page similar to the Django debugging page but without any sensitive information in.

I guess I can simply write my own, but does anyone have any ideas? Anything standard in Django I could use?

Thanks!

4
  • 1
    What useful information are you trying to show? Commented Apr 7, 2011 at 12:45
  • 1
    "simply write my own" Why wouldn't you? Also, you can use the standard debugging page, you know, without setting DEBUG. You can just call it. It's a regular function. Why not do that? Please explain more of what you're going to show. Saying what you won't show ("without any sensitive information") isn't a helpful set of requirements. Negative requirements (things you won't do) are not helpful. Commented Apr 7, 2011 at 12:59
  • @S.Lott: Please could you explain how to call the standard Django debugging page? I can't find this, at least not by Googling 'standard Django debugging page' and similar. Basically I'd like to show as much information as possible, without anything that might help hostile users hack the site. I know that's a negative requirement, but, well, I'm not certain of the future requirements - I need a page that I or the site users can use for debugging possible future problems. Commented Apr 7, 2011 at 14:10
  • "anything that might help hostile users"? Please think this through more carefully. Vagueness is what leads to security breaches. Commented Apr 7, 2011 at 14:28

2 Answers 2

1

Googling 'standard Django debugging page'

Isn't as effective as reading the Django source itself.

Look in base.py for code like this

from django.views import debug

That will provide you some hints as to how they do it.

Then you can look at django/views/debug.py for the "technical_404_response" view function. You can use this function in your code, also.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 for advice on reading Django source code:-). People are generally scared of reading sources of libraries the use and this is often of great help
1

You can use Django Debug Toolbar and enable it only for choosen IPs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.