Trevor
Trevor

Reputation: 13437

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?

Upvotes: 0

Views: 116

Answers (2)

topless
topless

Reputation: 8221

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..

Upvotes: 2

voscausa
voscausa

Reputation: 11706

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

Upvotes: 0

Related Questions