Python Forum
How to access routes using Bottle Framework
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access routes using Bottle Framework
#1
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>' )
Reply
#2
@app.route( '/log/<page>' )
def log( page ):
but i cannot access it like
url( '/log/<page>' )
Why? How can i access views in Bottle?
Reply
#3
(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?
Reply
#4
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?
Reply
#5
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
Reply
#6
it says it cannot find get_url

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue with bottle-pymysql nikos 13 5,359 Feb-23-2019, 11:15 AM
Last Post: nikos
  Passing a query value from a Bottle html template to a route with an encoding nikos 0 2,894 Sep-30-2018, 03:29 AM
Last Post: nikos
  django rest framework - custom routes SparrowhawkMMU 2 6,180 Jan-11-2018, 05:34 PM
Last Post: mariovalentino69
  please explain Bottle runtime log Kebap 4 7,420 Sep-22-2016, 05:40 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020