How to determine if your app is running on local Python Development Server?

后端 未结 1 2069
悲&欢浪女
悲&欢浪女 2021-02-13 15:51

I need to programatically determine if my app is running in development or not, so that I can provide sandbox values for a variety of constants and methods.

Something li

1条回答
  •  情深已故
    2021-02-13 16:36

    import os
    
    DEV = os.environ['SERVER_SOFTWARE'].startswith('Development')
    

    0 讨论(0)
提交回复
热议问题