Python Forum

Full Version: How to access routes using Bottle Framework
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i'am trying ti find the bottle's equivalenr for flask's

Quote:url_for( '/log', page=page[0] ), page[0] )

i try this as i actually i find out that module url exists but whn i try to acesss and endpoing like

Quote:url( '/log', page=page[0] ), page[0] )

i get the error of:

Quote:bottle.RouteBuildError: ('No route with that name.', '/log')



How can i access views in Bottle?

Please someone know how? The endpoint is present

@app.route( '/log/<page>' )
def log( page ):
but i cannot access it like url( '/log/<page>' )
@app.route( '/log/<page>' )
def log( page ):
but i cannot access it like
url( '/log/<page>' )
Why? How can i access views in Bottle?
(Feb-13-2019, 07:32 PM)nikos Wrote: [ -> ]
url( '/log/<page>' )
If this hypothetical function existed, what would you expect it to do or return?
I would expect it to return access to endpoint. I must access it somehow.

url_for() does this with Flask?

How does it go in Bottle?
How's this look?
http://bottlepy.org/docs/dev/api.html#bo...le.get_url

Quote:get_url(routename, **kargs)

Return a string that matches a named route
it says it cannot find get_url

Actually the way to write it is
Quote:app.get_url('/')
because its a class of Bottle.