Today I have successfully migrated this blog to Google App Engine (GAE) with only a change in the database settings by exploiting the new Google Cloud SQL.
Here are the steps I did:
- I followed this guide to setup my database in Google Cloud SQL.
- I uploaded the database backup file to Google Cloud Storage to be able to import it to Could SQL.
- I created another app in GAE to serve my static files, then modified my STATIC_URL setting. Before deploying files, I ran django-staticfiles command "collectstatic" locally to collect my static files from my Django app.
- To deploy the environment applications, I created a symlink to the site-packages into the project folder and added this in the settings:
if not DEBUG:
sys.path.insert(0, os.path.join(PROJECT_DIR, "env"))
- To minimize cost, I modified the code to use GAE Memcache as described here.
Problems I encountered:
- I noticed that django comment app isn't working. Will update this blog once I got it working. If you need to comment on this blog, please email me instead until I fix this problem.
- I'm still trying to figure out how use Django model's FileField. I read some articles mentioning Google Cloud Storage but I wonder how would the native django code could do that.
- The application cannot send email alerts when error is triggered.
- The application loads slow because of the delay in loading the static files and starting the database instance from Cloud SQL.
- I cannot use Django South to manage changes in the database structure.
Update (2012-06-12): I eventually moved this blog site to Amazon EC2 using a micro reserved instance. The price is only $0.008/hour as compared to Google Cloud SQL which is $0.1/hour. This also gives me flexibility and freedom on how will I deploy the static files and use python-virtualenv.
by Noel Pure
I'm a Python web developer by profession and the author of Noel Codes
and Ancient Views
. I like coding and reading books, specially the Bible.