Skip to content

Commit 5d18f48

Browse files
committed
add redirect to default page for bottle
1 parent 4950fe5 commit 5d18f48

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

v3/bottle_server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212
# I had to replace cStringIO with io and urllib2 with urllib, for
1313
# compatibility from 2.x to 3.x Ii was running from /v3/).
1414

15-
from bottle import route, get, request, run, template, static_file
15+
from bottle import route, get, request, run, template, static_file, redirect
1616
import StringIO # NB: don't use cStringIO since it doesn't support unicode!!!
1717
import json
1818
import pg_logger
1919
import urllib
2020
import urllib2
2121

2222

23+
@route('/')
24+
@route('/index')
25+
def redirect_home():
26+
redirect('index.html')
27+
2328
@route('/<filepath:path>')
2429
def index(filepath):
2530
# special-case for testing name_lookup.py ...

v3/docs/developer-overview.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,14 @@ who set up OPT on his Ubuntu laptop. (btw [Hacker School](http://www.hackerschoo
5252
Google App Engine works only with Python 2, not Python 3. So if you want to run with Python 3 as well,
5353
first install the [bottle](http://bottlepy.org/) micro web framework:
5454

55-
easy_install pip
5655
pip install bottle
5756

5857
And then run:
5958

6059
cd OnlinePythonTutor/v3/
6160
python bottle_server.py
6261

63-
If all goes well, when you visit this URL, you should see the Python Tutor visualizer:
64-
65-
http://localhost:8080/visualize.html
66-
67-
Note that you can run bottle with both Python 2 and 3.
62+
If all goes well, you should see the main Python Tutor page at http://localhost:8080/
6863

6964
However, **only** run this app locally for testing, not in production, since security checks are disabled.
7065

0 commit comments

Comments
 (0)