Micro framework web App with python bottle
-
requires
1.1 python 2.7
1.2 pip
-
run install.py
$python install.py
-
run pycabRequires.py
$python pycab.py $ run requires
Make a great web page with this framework in easy way
to run a localhost:
$python run_server.py
or
$python pycab.py
$ run server
in this file you can find all of basical configurations of a project
Is a principal function of a route, it's used to intereact with our clients and interact with our site logic.
Controller return a view.
-
ROOT/controllers
-
$python pycab.py $ make controller
from resources.view import view
def main():
return view('home',title='home')
Is the way to impement a exists controller
Routes run a controllers functions using a http methods: GET, POST, PUT...
-
-
ROOT/routes/web/web.py
-
ROOT/routes/api/api.py
-
-
Route.get(nameofroute)(controller)
-
from resources.routes import Route from controllers.controller import home Route.get('/')(home)
dynamic routing
```python from resources.routes import Route Route.get('/<id :int>')() Route.get('/<ids :list>')() ```