How do you setup a settings file? One is for your local development server and another set of setting values for when you upload to Google App Engine?
For example, I would like to set up a settings file where I store the Absolute Root URL.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not clear from your question if you’re asking about the Java or Python runtime. I’ll assume Python for now.
Just like any other Python webapp, the settings file can be wherever and whatever you want. I usually use a .py file called ‘settings.py’ or ‘config.py’ in the root directory of my app. For example, see Bloog’s settings file.
As far as having different settings for production and development goes, you have two options:
Autodetect which platform you’re running on, and apply settings as appropriate. The easiest way to do this is to check the value of os.environ[‘SERVER_SOFTWARE’], which will start with ‘Dev’ if it’s the development server. You can use this to set a flag like so:
DEBUG = os.environ[‘SERVER_SOFTWARE’].startswith(‘Dev’)