- Create on appengine.google.com your app id. If you register myapp, you will be able to access it at http://myapp.appspot.com .
- Download takatu from class web site and unzip it.
- Add your application in the application folder.
- Rename your db.py to db.py.old, and copy the db.py that comes in the atakatu app to your own app.
- Edit db.py of your application. You need to decide how to connect to a database on appengine.
- If you use the datastore, you can use:
db = DAL('sqlite://storage.sqlite')
- If you want to use SQL, you need to create a Google Cloud SQL instance; see the instructions below as well. You will want to have this line (replace project, instance, database with your data of course):
db = DAL('google:sql://project:instance/database', migrate_enabled=True)
- Change routes.py and app.yaml to refer to your app instead of atakatu (simply search and replace for atakatu).
- Make sure that you have migrate_enabled=True in db.py . This is important, or the new tables will not be created.
- At this point, if you have a local installation of mysql, you can test locally via Google AppEngine Launcher. This is very much advised, since it is much easier to debug locally (the turn-around time is shorter).
- Hint: did you follow my advice to develop in linux, maybe in a vm? If so, it is easy to have a local instance of mysql installed and running; there is ample help on how to do this. For the sake of simplicity, you might want to set up your mysql server to require no password from localhost. Otherwise, you can pass the password to connect to localhost as an argument to dev_appserver.py . Do
dev_appserver.py --help
for a list of command line options (this is also well documented on the appengine site).
- Upload your application with Google AppEngine Launcher, and run it.
Setting up Google Cloud SQL
You can set up Google Cloud SQL here. You need to allow billing. I advise you to get an instance of size D0 (the cheapest) using the per-use plan, which means that you are billed only when the DB is in use; it should not cost you more than $10/month for that (it's one quarter for each 10 hours of running time). If you want faster response times, you can get the D0 instance as "package", meaning that you pay a (small) fixed amount for always-on performance. Here are the prices.