LoginSignup
2
0

More than 5 years have passed since last update.

python のフレームワークを使ってみた

Last updated at Posted at 2018-10-18

目的

Pythonについて経験が浅いので、フレームワークを利用しながら、知識を深めました。

目標

目標は、turboGearsフレームワークを利用して何かを作ることです。

TurboGearsとは

TurboGearsとはMochiKit、SQLObject、CherryPy、Kidなどの基礎となる
コンポーネントの上に構築されているらしいです。
参考サイト
http://www.turbogears.org/index.html
https://ja.wikipedia.org/wiki/TurboGears

Pythonで確認した内容

TurboGearsで利用することができる、CherryPyを自分が利用しているMacPCで動かしました。

CherryPyを動かしてみた

始めにCherryPyを実行するプログラムを取得しました。

git clone https://github.com/cherrypy/cherrypy

ソースコード取得すると、チュートリアル用のプログラムが存在するので、実行をしてみました。

macbook:tutorial mac$ python tut01_helloworld.py 
[19/Oct/2018:07:10:17] ENGINE Listening for SIGHUP.
[19/Oct/2018:07:10:17] ENGINE Listening for SIGTERM.
[19/Oct/2018:07:10:17] ENGINE Listening for SIGUSR1.
[19/Oct/2018:07:10:17] ENGINE Bus STARTING
[19/Oct/2018:07:10:17] ENGINE Started monitor thread 'Autoreloader'.
[19/Oct/2018:07:10:17] ENGINE Serving on http://127.0.0.1:8080
[19/Oct/2018:07:10:17] ENGINE Bus STARTED

WEBブラウザ上で以下のURLを実行することで、動作確認をすることができました。

http://127.0.0.1:8080

チュートリアルのソースコードは、10ファイル存在しており、CherryPyの様々な機能に触れることができます。

最後に

簡素ながら、フレームワークの利用したことを記載させて頂きました。
機会があれば、TurboGearsの記事についても投稿させて頂きたいと考えております。
ご一読して頂き、ありがとうございます。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0