Created
February 24, 2012 19:33
-
-
Save dangayle/1903175 to your computer and use it in GitHub Desktop.
Python Bottle SQLite Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This works: