Skip to content

Instantly share code, notes, and snippets.

@chucknado
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chucknado/598393e74e91a7817c71 to your computer and use it in GitHub Desktop.
Save chucknado/598393e74e91a7817c71 to your computer and use it in GitHub Desktop.
A Bottle app starter file for the Zendesk OAuth tutorial at https://support.zendesk.com/hc/en-us/articles/204210446
from bottle import route, template, redirect, static_file, error, request, response, run
@route('/home')
def show_home():
return template('home')
@route('/')
def handle_root_url():
redirect('/home')
@route('/zendesk_profile')
def make_request():
# make API request
profile_data = {'name': 'Lea Lee', 'role': 'admin'}
return template('details', data=profile_data)
@route('/css/<filename>')
def send_css(filename):
return static_file(filename, root='static/css')
@error(404)
def error404(error):
return template('error', error_msg='404 error. Nothing to see here')
run(host='localhost', port=8080, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment