🏆 超過70萬名讀者已閱讀本站的內容,共同創造了105萬次總閱讀次數!
Google Cloud SQL 是 non-relational database, 而 Django 本身是只支援 traditional databases, 所以 Django 要上 GAE 的話, 要注意的是原始 Django framework 不能再用了, 要改用 Django-nonrel 這個專案.
https://github.com/django-nonrel/django
另外要注意的是, 目前不管是 django-nonrel 的 testapp
https://github.com/django-nonrel/django-testapp
還是 Google Cloud Platform 的 django-skeleton
https://github.com/GoogleCloudPlatform/appengine-django-skeleton
都是用 execute_manager 這個 function, 在目前 Django 版本 (1.6) 已經不支援它了. 所以就單純化問題來說, 電腦最好不要安裝新版 Django. 安裝 django-nonrel/testapp 與 Google Cloud Platform/django-skeleton 時下載相依檔案時會下載 django-nonrel 的 1.4 版 (其他相依模組也是 1.4 版).
django-nonrel/testapp 與 Google Cloud Platform/django-skeleton 的差異? django-skeleton 的 app.yaml 有加 comment. 如果不算 comment 或 README 的話, 兩個 project 算是相同. 接著分析一下上述專案的架構, 它包含5個 app
autoload
dbindexer
django
djangoappengine
djangotoolbox
程式進入點 djangoappengine.main.application 位於 djangoappengine/main/__init__.py
application = WSGIHandler()
launch 起來看到的頁面是 /templates/home.html, 依照 Django 的架構, 由 /url.py 所指定. Nice article:
http://blog.wu-boy.com/2009/04/django-web-framework-django-%E5%88%9D%E9%9A%8E%E5%AD%B8%E7%BF%92%E5%BF%83%E5%BE%97/
我是 Larry,經營 B2B 軟體公司超過 10 年,也持續寫作超過 15 年。
我會持續分享自己對商業、科技與生活的觀察。
如果你喜歡這篇文章,也歡迎追蹤我的社群:
📌 Threads|日常觀察與商業思考
📌 FB|文章與生活分享
📌 IG|旅行、美食短影片



