storing app settings on Google App Engine

google-app-engine, python, settings

Solution

Please clarify what does "feel clumsy" to you about this -- that's not very clear to me.

The datastore is the way to persist updatable data in App Engine (blobstore's for huge blobs, memcache's not guaranteed persistent). If your settings can't be changed by the application of course you can just put them in your own custom `.yaml` file (or whatever, but yaml's how App Engine's own configuration files are already stored anyway...;-); just remember all such files are read-only from the application's viewpoint. YAML is conveniently available to App Engine apps for parsing their own `.yaml` (but "read-only") files.

Problem

I need to store settings for my Google App Engine project. Currently I have: ``` class Settings(db.Model): rate = db.IntegerProperty(default=4) ... ``` And when I want to use it: ``` Settings.get_or_insert('settings') ``` This feels clumsy so is there a better way (without using Django)?

Original source