Skip to content

Instantly share code, notes, and snippets.

@zelark
Forked from dangayle/gist:1903175
Created June 2, 2014 14:28
Show Gist options
  • Save zelark/1d79c3ce63d5a4795d6d to your computer and use it in GitHub Desktop.
Save zelark/1d79c3ce63d5a4795d6d to your computer and use it in GitHub Desktop.
from bottle import route, run, install
from bottle_sqlite import SQLitePlugin
install(SQLitePlugin(dbfile='bottle.db'))
@route('/db/')
def database(db):
data = db.execute('SELECT SQLITE_VERSION()').fetchone()
print "SQLite version: %s" % data
run(host='localhost', port=8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment