Google App EngineでDjangoっぽくアプリ作る。Hello Worldの1歩先。あとで読む

まだGAEのウェイティングリストからポップアップしてません。クボケーです。

秋元さんやらamachangやら、すでにGAEでHello Worldくらいまではあちこちで解説が出ているので、その一歩先を解説します。簡単にいうと、Django的なMVCフレームワーク分離です。テンプレートでHTMLを記述したり、CSSやJavascriptなどのスタティックファイルを読み込んだりすることもできるようにします。

There are a lot of people who wrote about how you say hello world in GAE. Thus, I show you a step further from there. I explain how to use Django-like MVC framework, static files like CSS and Javascript, and html templates in GAE.



Google App Engineは、Djangoをベースにしています。GAEでDjangoを動かす方法のチュートリアルも公開されているのですが、現時点ではエラーで動きません。

Google App Engineis based onDjango. There is a tutorial of Running Django on Google App Engine. However, you know, the tutorial arises errors and doesn't work now.

そこで、Djangoっぽいディレクトリ構造のテストプロジェクト+テストアプリを作成しました。単純なファイルですので、これを見ながら、手作業で既存のDjangoアプリをGoogle App Engine用に作り替えることもできると思います。

So I created a MVC structured GAE application on my own. The files are really simple. Using my files, you can create your original application or convert your Django application for GAE by hand.

下記のURLからダウンロードしてください。

Now you can download the file from the following URL.

Download

使い方:

Howto:

まず、解凍してできたmytestフォルダを適当なところに設置してください。
あとは、GAEのチュートリアルにあるようにmytestをルートにして、サーバーを立ち上げるだけです。

First, unzip the mytest.zip and put the folder in your working directory. Then, launch GAE server with the following command.

> dev_appserver.py mytest

--
ファイル内容の解説:
Explanation of the included files:

/_static
... CSSやJavascriptなどのスタティックファイルを設置。
... Put static files such as CSS or Javascript.

/_templates
... その名のとおり、HTMLテンプレートを設置する場所。
... Put HTML templates here.

あとは、Djangoと同じかGAEのチュートリアルと同じなので、わかると思います。わからなければコメントでどうぞ。もしよかったらブログなんかで取り上げてもらえるとうれしいなぁ。

All other files are the same as what in the tutorials of Django or of GAE. Thus probably you can understand the role of them. If you have further questions, feel free to put comments or send trackback to this post.

ではでは。

2008/04/09 00:44 | djangoCOMMENT(1)TRACKBACK(0)はてなブックマークする TOP

  • Webクリエーション・アウォードから派生して駄文 (05/13)
  • Google App EngineでDjango (04/09)
  • Google App EngineでDjangoっぽくアプリ作る。Hello Worldの1歩先。 (04/09)
  • CSSEZリニューアルでお世話になりそうなあれこれまとめ。 (04/03)
  • CSSEZのリニューアルをちょっと垣間見てみない?? (03/31)
  • Vicunaにあったらいいなと思うあれこれ。 (03/28)
  • YUIさんとYUI RADIO (03/06)
  • 敢えて「ひいき」するということ。 (12/14)
  • プロセスの柔軟性を奪うことは何をもたらすのか。 (12/13)
  • ZAPAさんが読みたいブログ(自薦)募集中。 (12/09)
  • コメント

    windowsで試してみました
    main.pyの
    /home/kei/workspace/mytest/_templatesを
    C:Program FilesGooglegoogle_appenginemytest_templates
    に変更して
    動作いたしました。

    これをサーバーに上げるときは
    どういう指定にしておけばいいのか
    進める予定です。

    ありがとうございました。

    No:60 2008/06/03 12:42 | takao #- URL [ 編集 ]

    コメントの投稿



    管理者にだけ表示を許可する

     | BLOG TOP |