SAE Django Journal 1

可能是因为看silicon valley的原因,心血来潮想把django捡起来,以后搞个公众号什么的,却发现haroku在国内奇慢无比,在被墙的边缘徘徊,只好转投sina的SAE,却发现坑太多,搞了5个小时才把最基本的setup搞上去。

坑1: Django version

Default support is 1.4, are you kidding me? That was released in fucking 2012!!! I have to upload 1.10 package.

坑2: No sqlite support

Forced to switch mysql which I spent quite a long time to setup, all kinda of issues happened.

坑2: Database migration

This is some pain in the ass I never experienced in Heroku. Basically, there is no way you can automatically sync up the local database to SAE. They provided a crappy API which is supposed to help you to deal with this shit by directly using database on SAE but anyway something like below

from sae._restful_mysql import 
monkeymonkey.patch()

Amazingly, this shit doesn't work for initial migrate, it failed with 13013 error code and there are 100+ posts asking about this error code but no answers. The solution is

  • run a local database first
  • get the sql dump file nd upload to SAE
  • switch to the API and then it starts to work

你可能感兴趣的:(SAE Django Journal 1)