bottlepy / bottle

bottle.py is a fast and simple micro-framework for python web-applications.
http://bottlepy.org/
MIT License
8.44k stars 1.47k forks source link

Redirecting from another file #273

Open janus opened 12 years ago

janus commented 12 years ago

user.py

user_app = bottle.Bottle() @user_app.route('/login') def login(): redirect("/index")

app.py

from user import user_app root_app = bottle.Bottle() @root_app.route('/index') def index(): return "Bottle is awesome"

root_app.mount('/user', user_app)

I would like to redirect from one file to another, is this possible?

bbrodriges commented 12 years ago

Read this thread in Google Groups https://groups.google.com/group/bottlepy/browse_thread/thread/642049a6ae1d725e/5c1a745bb0d9d595?hl=en&lnk=gst&q=routes#5c1a745bb0d9d595