If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

Sceenshot

Web2py Environment

Add this HTML to your layout

<div id="web2py">
        <h1>Web2py Environment</h1>
        <div id="w2p_environ">
            <div id="w2p_request">
                <h2>Request</h2>
                <div class="data">
                    {{=BEAUTIFY(request)}}
                </div>
            </div>

            <div id="w2p_response">
                <h2>Response</h2>
                <div class="data">
                    {{=BEAUTIFY(response)}}
                </div>
            </div>

            <div id="w2p_session">
                <h2>Session</h2>
                <div class="data">
                    {{=BEAUTIFY(session)}}
                </div>
            </div>
        </div>
    </div>

Add this CSS

Do alter the CSS to fit your website, so it can be useful and not in the way.

#web2py {
    position: absolute;
    top: 5px;
    left: 5px;
    height: 5%;
    width: 25%;
    background-color: #111111;
    color: white;
    overflow: auto;
}

#web2py h1 {
    margin: 0;
    padding: 0;
}

#web2py #w2p_environ {
    position: absolute;
    top: 50px;
    left: 5px;
    height: 100%;
    width: 100%;
    background-color: #111111;
    color: white;
}

#web2py .data {
    display: none;
    overflow: auto;
    position: relative;
    height: 600px;
    width: 100%;
}

Add this Javascript

            web2py_height = "5"
            jQuery("#web2py #w2p_environ").hide();
            jQuery("#web2py .data").hide();
            jQuery("#web2py h2").bind("click", function() {
                jQuery("#web2py .data").slideUp();
                jQuery(this).next().slideDown();
            });
            jQuery("#web2py h1").bind("click", function() {
                if (web2py_height == "100"){
                    web2py_height = "5"
                }else{
                    web2py_height = "100"
                }
                jQuery("#web2py").css({
                    "height": web2py_height + "%",
                });
                jQuery("#web2py #w2p_environ").slideToggle();
            });

Related slices

Comments (3)

  • Login to post



  • 0
    rochacbruno 12 years ago

    Now web2py has it built in:

    {{=response.toolbar()}}

    So, I think this slice can be flagged as deprecated, or maybe I can create a flag "included in web2py Version x.x.x"


  • 0
    thadeusb 15 years ago
    I was thinking of making it work more like the django debug toolbar, and I would like to make it look a lot nicer/functional before I packaged it into a plug-in.

  • 0
    aleksdj 15 years ago
    Very interesting Thadeus, I will give it a try! Maybe you could create as a plugin for we2py.

Hosting graciously provided by:
Python Anywhere