From within a Play 2.1 application, how would I programmatically determine which mode the application is running in (i.e., Development vs. Production)?
For example, it would be useful to be able to do something like this from inside a template:
<p>@if(__some_play_API_call__ == Dev) { <b>Development mode</b> }</p>
In the Play 2.0 API documentation, there appears to be a mode property of the play.api.Application class… however, I am unsure about how to get at the instance of the currently running application.
You can access the current Appliction via
to find out the mode try
or simply use