I'm lazy! And I just want to store one single string value. That's all! Can I jump over any kind of Modeling and just store a value?
Not as far as I know: the DataStore is the only storage available on App Engine. However, it's not a lot of code, even if you are lazy. ;)
Make sure you import the db
module:
from google.appengine.ext import db
Then just store a key/value pair (you can then use this model to store any other miscellaneous strings you might add as well):
class MyData(db.Model):
myKey = db.StringProperty(required=True)
myValue = db.StringProperty(required=True)
data = MyData(myKey="Title", myStringValue="My App Engine Application")
data.put()
You can get it again with:
db.Query(Entry).filter("myKey=", "Title").get().myStringValue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With