Differences between revisions 3 and 4
Revision 3 as of 2005-09-02 10:54:00
Size: 1298
Editor: 211
Comment:
Revision 4 as of 2011-08-03 11:00:49
Size: 1298
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

[Python] WebProgramming 프레임워크 (SeeAlso Quixote)

http://www.mems-exchange.org/software/quixote

이름은 돈키오테의 그 키오테 이다. 웹프로그래밍을 보다 더 쉽게 할 수 있는 환경을 제공한다. template language가 따로 구분되어있다. 또한 다양한 서버환경에 적용가능하다. ([Apache], FastCgi, [SCGI], [Medusa], [Twisted]등)

BioPython 웹사이트가 이것으로 만들어져 있다.

demo를 통해 본 기본적인 사용법

[URL]마지막부분을 바로 함수로 호출한다. 즉

http://yourhost/demo.cgi/simple

은 app = Publisher('quixote.demo') 가 가리키는 네임스페이스 디렉토리의 __init__.py 에서 곧바로, simple이란 함수를 호출한다. simple은 PTL로도 표현되며 다음의 모습을 갖는다.

   1 def simple [plain] (request):
   2     request.response.set_content_type("text/plain")
   3     print "debug message from the index page"
   4     "This is the Python function 'quixote.demo.simple'.\n"

여기서, 프린트문은 로그에 출력되며, [HTTP]헤더가 text/html일때는 생략해도 된다. 인수로 넘겨지는 request는 이후 [CGI] 환경변수, [Cookie]등의 정보를 빼낼때 쓰인다.


CategoryProgramLibrary

Quixote (last edited 2014-04-08 13:10:42 by 61)

web biohackers.net