简体   繁体   中英

What is the best way to create a collection of system properties for a google app engine website in python?

I'm trying to create some custom system properties, which can be changed in the admin section of the website. While exploring some options I realized that I may be trying to do things too much like I would in C# and not embracing python patterns of programming.

I created an entity (SystemProperty) with a custom key and a single property (Value). I then created a SystemProperties class with a bunch of "static properties" that represent the system properties stored in the datastore. I want to use this SystemProperties class when ever I reference or update one of the system properties, however, I think I might be going about this the wrong way. Anyone have a good suggestion for how to effectively manage system properties on Google App Engine using python?

We use gae-init to bootstrap all our projects. You can get a clear idea how we handle the system properties under the config section along with lots of other great automations for building deploying minifying etc..

It depends on the type of properties. I use a module, appengine_config,py (hooks) and app.yaml (Environment Variables : os.environ) to store properties without using the datastore. But this setup requires a new deployment of your application to update properties, or you have to build a module reload function.

See also Python Module configuration: https://developers.google.com/appengine/docs/python/tools/appengineconfig

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM