Flask (A Python Micro Framework)
is a very promising so-called micro-framework for the development Python web applications. After installing mod_wsgi (See my previous post
installing mod_wsgi on Mac OS X 10.6 is a very promising so-called micro-framework for the development Python web applications. After installing mod_wsgi (See my previous post
), is the use of Flask on Mac OS X no more obstacles. I go in the following assume that Python 2.6 and Python Setup Tools are already installed with MacPorts. Then you should
/ opt/local/bin/easy_install-2.6
third An example application Write:
> pico helloflask.py
import from flask Flask
def hello_flask ():
return "Hello Flask!"
if __name__ == "__main__":
app.run ()
> pico hello.wsgi
import sys
sys.path.append ("/ Users / username / Sites / webapp") from helloflask import app as application
hello.wsgi and helloflask.py
should be put in / Users / username / Sites / webapp 5th mydomain.org call:
that the configured WSGIScriptAlias should be part of the Virtual Host
mydomain.org (See Installation of mod_wsgi on Mac OS X 10.6 ).
If everything went well we welcomed our first Flask Web application when calling
mydomain.org
mydomain.org
in the browser with "Hello Flask!" .
0 comments:
Post a Comment