Professional Documents
Culture Documents
Python3 Web Development - First Step To Flask - Part 1
Python3 Web Development - First Step To Flask - Part 1
http://crossnetmm.com/?p=1066
$ tree hello_flask/
hello_flask/
|-- static
`-- templates
def index():
pass
app.add_url_rule('/', 'index', index)
Starting the server - server က စဖအတက flask object ရ run method (app.run() ) က ခ ပ မယ
.. ဒ နရ မ တစခရင ပခ ငတ က တက ကလမ မ ခ ပ if __name__ == "__main__": က
ထညရခ င အ က င ကပ .. ဘ လလဆ တ hello.py သည တစ ခ က န import လပထ တ မဟတပ main
program အ နန run နလ ဆတ က စစတ ပ .. Run နတယဆမ app.run() က ခ ပ server က run
စပ တယ။
Running on http://127.0.0.1:5000/ လ default အတင ပ နပ လမမယ Web Browser က န
လမ ပ တ localhost:5000 (IP:port) လ က ပ enter ခ ကလကရင flask server ရ homepage က
သ ပ တယ homepage န bind ထ တ view funtion လ က response လပတ မ Hello Word ဆ ပ
မငရတ ပ ။