python2.7: Could not import get_url from bottle

1.6k views Asked by At

I can't import the get_url from bottle:

from bottle import get_url

The error is:

Traceback (most recent call last):
  File "./py_test.py", line 4, in <module>
    from bottle import get_url
ImportError: cannot import name get_url

There is no error when I load any other one like: run, post, get, route, view, static_file, template, ...

1

There are 1 answers

1
Daniel Roseman On BEST ANSWER

Bottle doesn't seem to expose a get_url function. It does have a url function, which wraps the Bottle.get_url method for the default application.