AliyahZafar / Study-

0 stars 0 forks source link

Study BottleFrameWork #2

Open AliyahZafar opened 10 years ago

AliyahZafar commented 10 years ago

Website:

http://bottlepy.org/docs/dev/index.html

Tutorial:

http://bottlepy.org/docs/dev/tutorial.html
AliyahZafar commented 10 years ago

Problem in installing Window's 8... Bit problems in understanding route , template thing

AliyahZafar commented 10 years ago

@route('/hello') >>> is /hello is a folder ??? createrd by route that will bind /hello folder to the hello() function ?

AliyahZafar commented 10 years ago

Request Routing??

kashifpk commented 10 years ago

Don't worry about installation, will do that in Linux. Bottle is just one single python file which can be placed in project folder so installation is not even required

kashifpk commented 10 years ago

In routing there are no folders involved, unlike normal php where a URL is mapped to a PHP file, in frameworks urls are mapped to functions. Meaning a function is executed when a URL is accessed by the client. So

@route('/hello')
def myfunc( ):
     return "hello world"

Means when user accesses the /hello URL then execute function myfunc which just returns the string "hello world" and that is displayed in the browser.

This as explained above is request routing. Simply request routing is linking code/functions to URLs

AliyahZafar commented 10 years ago

I didn't get the arguments passsing n request routing example that was bit weird :/ ... Plus i've seen bootstrap n applied few things