Skip to content
train07 edited this page Feb 7, 2012 · 19 revisions

There are a number of "gotchas" to keep in mind on the willet-referrals platform.

App Configuration

There are a few notes regarding app configuration.

App YAML

app.yaml

With Google App Engine (GAE), the basic information to control your app is stored in the app.yaml file in the base of the repository. Because the app.yaml specifies the GAE "Application Name" that you will push to when you deploy your code, each developer usually wants to maintain their own app.yaml file. As such, app.yaml is included in the .gitignore.

For a basic app.yaml please see README in the base of the repository.

App Consts

util/consts.py

This file contains all the application constants, such as API keys or debug flags.

Development App Consts

util/local_consts.py

Because a developer may want to test some local settings (such as setting the DOMAIN to be their development environment) but we don't want them changing util/consts.py and accidentally deploying their development settings, we recommend you create util/local_consts.py in your local branch. It will be automatically included by util/consts.py

Map Reduce

Map Reduce Status page

Troubleshooting

Code Redirecting To / ?

Ask yourself: Did you add a new URI that you are trying to hit?

If YES, the URI router in memcache needs to be updated! Go to /admin/reload_uris and try again!

If NO, then you have a syntax error and the logs are eating it up. Good luck.

500 Error for a new CLEAN Deployment (ie. not models in DB)

Go to /link/init.

Manual DB Change Not Being Reflected?

It's not in memcache yet! Use the memcache viewer / clearer at /admin/... ... memcache? Try (your).appspot.com/admin/reload_uris and (your).appspot.com/admin/reload_uris?all=true.

App in Memcache

Apps are memcached via app-UUID AND STORE_URL

Need to update a Model instance in the db?

It'll take more steps than what you think.

  • Update the model in the db and Save it.

  • Determine how that model is memcached (could be memcached a few times)

  • Go to Memcache Admin Console and clear those values from memcache

  • Verify the db entry wasn't overwritten by bad memcache value. Verify new memcache value is correct.

  • Done!

Removing Deleted Properties from the Datastore

If you remove a property from your model, you will find that existing entities still have the property. It will still be shown in the admin console and will still be present in the datastore. To really clean out the old data, you need to cycle through your entities and remove the data from each one. Make sure you have removed the properties from the model definition.

If your model class inherits from db.Model, temporarily switch it to inherit from db.Expando. (db.Model instances can't be modified dynamically, which is what we need to do in the next step.)

Cycle through existing entities (like described above). For each entity, use delattr to delete the obsolete property and then save the entity.

If your model originally inherited from db.Model, don't forget to change it back after updating all the data.

Clone this wiki locally