Python Pylons のフォルダ構成



paster create -t pylons helloworld

で作成したフォルダの中身を見てみます。

helloworld

development.ini
にサイトの設定が記載されています。


helloworld/helloworld/config

・environment.py
controllersフォルダや、templatesフォルダの場所の記載。
・routing.py
URLからどのモジュールをロードするかのルールを記載。


helloworld/helloworld/controllers

実際に動作するモジュールたちです。


helloworld/helloworld/lib

・helpers.py
テンプレートエンジンで使用できるヘルパークラス


helloworld/helloworld/model



helloworld/helloworld/public

apacheでいうドキュメントルートです。



helloworld/helloworld/templates

controllersから呼び出すテンプレートファイルを配置します。


helloworld/helloworld/tests




もどる