With a little bit of style in debug.html, I think this kind of thing could
be added to layout.html of welcome. this is very usefull.

May be included as a toggle sidebar, or topbar

2010/11/17 Bruno Rocha <[email protected]>

> Nice!
>
> I put this in the end of layout.html
>
> ....
> </body>
>
> {{if DEBUG_MODE:}}
>    <hr>
>    {{include 'debug.html'}}
> {{pass}}
>
> </html>
>
> and in my models/0.py
>
> if 'debug_mode' in request.args:
>     DEBUG_MODE = True
>
> or
>
> if request.env.http_host == '127.0.0.1':
>    DEBUG_MODE = True
>
>
> or just DEBUG_MODE = True
>
>
> Very useful!
>
> Tks
>
> 2010/11/12 demetrio <[email protected]>
>
> Hi, I've realized that it might be helpful, to include a template
>> called "debug.html" with the same code found in "generic.html." but
>> without the {{extend}} statement. I am using in my development and
>> saves me some time to write several "BEAUTIFY" calls.
>>
>> When I want to be in "development mode", I just write {{include
>> 'debug.html'}} in my template.
>>
>> The code would be:
>>
>> {{=BEAUTIFY(response._vars)}}
>> <button
>>
>> onclick="document.location='{{=URL("admin","default","design",args=request.application)}}'">admin</
>> button>
>> <button onclick="jQuery('#request').slideToggle()">request</button>
>> <div class="hidden" id="request"><h2>request</h2>{{=BEAUTIFY(request)}}
>> </div>
>> <button onclick="jQuery('#session').slideToggle()">session</button>
>> <div class="hidden" id="session"><h2>session</h2>{{=BEAUTIFY(session)}}
>> </div>
>> <button onclick="jQuery('#response').slideToggle()">response</button>
>> <div class="hidden" id="response"><h2>response</
>> h2>{{=BEAUTIFY(response)}}</div>
>> <button onclick="jQuery('#auth').slideToggle()">auth.user</button>
>> <div class="hidden" id="auth"><h2>auth.user</
>> h2>{{=BEAUTIFY(auth.user)}}</div>
>> <script>jQuery('.hidden').hide();</script>
>>
>>
>> I also added the variable auth.user to this code.
>>
>> I hope you find this something useful.
>
>
>
>
> --
>
> Bruno Rocha
> http://about.me/rochacbruno/bio
>



-- 

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to