Forums

Detect script running on PAW vs. local development

I've got a Flask application, that I run locally for development and then deploy on PAW for production. In my app, I've got a config.py file that I keep various parameters that are different between development and production. Is there some method through code that I could include in my config file to detect my local setup vs. being deployed on PAW?

As it is now, I manually change a couple config items when I deploy, but I know someday that will bite me if I don't automate the detection.

Several ways - take a look at https://www.pythonanywhere.com/forums/topic/1265/#id_post_8822 for two examples.

HTH Jim

That will do it for me, I'll give this a try in the morning. Thank you Jim.

;----)