{{extend 'layout.html'}} {{block sectionclass}}debug{{end}}

{{=T("web2py online debugger")}}

{{if filename:}}

{{=T("Interaction at %s line %s") % (filename, lineno)}}

{{if exception:}}

{{=T("Exception %s", exception['title'])}}

{{pass}}
Code listing
{{if lines:}}
{{=CODE('\n'.join([x[1] for x in sorted(lines.items(),key=lambda x: x[0])]),
                language='python', link=None, counter=min(lines.keys()), 
                highlight_line=lineno, context_lines=10)}}
{{pass}}
  • Your application will be blocked until you click an action button (next, step, continue, etc.)
  • Your can inspect variables using the console bellow

{{=T("Interactive console")}}

>>>
Type python statement in here and hit Return (Enter) to execute it.
{{elif request.env.get('wsgi_multiprocess') or not request.env.get('wsgi_multithread'):}}

{{=T("Unsupported webserver working mode: %s") % request.env.get('server_software', '')}}

  • WARNING: This debugger may not work properly if you don't have a threaded webserver or you're using multiple daemon processes.
  • In development, use the default Rocket webserver that is currently supported by this debugger.
  • On production, you'll have to configure your webserver to use one process and multiple threads to use this debugger.
  • {{#=BEAUTIFY(request.env)}} {{else:}}

    {{=T("No Interaction yet")}}

    • You need to set up and reach a {{=A("breakpoint", _href=URL('breakpoints'))}} to use the debugger!
    • To emulate a breakpoint programatically, write: {{=CODE("from gluon.debug import dbg\n" "dbg.set_trace() # stop here!\n", counter=None)}}
    • Please {{=A("refresh", _href=URL('interact'))}} this page to see if a breakpoint was hit and debug interaction is required.
    {{pass}}