Changed the debug settings to use an environment variable to differentiate between production and development.