title: How to detect application mode in Play 2.x
body: <p>From within a Play 2.1 application, how would I programmatically determine which mode the application is running in (i.e., <em>Development</em> vs. <em>Production</em>)?</p>
  
  <p>For example, it would be useful to be able to do something like this from inside a template:</p>
  
  <p><code>&lt;p&gt;@if(__some_play_API_call__ == Dev) { &lt;b&gt;Development mode&lt;/b&gt; }&lt;/p&gt;</code></p>
  
  <p>In the Play 2.0 API documentation, there appears to be a <code>mode</code> property of the <code>play.api.Application</code> <em>class</em>... however, I am unsure about how to get at the <em>instance</em> of the currently running application.</p>