[pylons-discuss] Re: How to check in view code if it runs in development or production mode now?

2015-09-29 Thread Dmitry Komarov
Thanks to all! Your answers were inspiring, detailed and useful! -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscr...@googlegroups.com.

[pylons-discuss] Re: How to check in view code if it runs in development or production mode now?

2015-09-29 Thread Jonathan Vanasco
If you don't want to deal with examining the request each time, you can populate the templating environment with a variable or even a function/package that has the tests using event subscribers. def BeforeRender_event(event): request = event.get("request") or threadlocal.get_current_request(