Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import bottle
  2. import bottle_mysql
  3. from bottle import route, run, template, app
  4.  
  5. app = bottle.Bottle()
  6. plugin = bottle_mysql.Plugin(dbuser='root', dbpass='toor', dbname='database')
  7. app.install(plugin)
  8.  
  9. @route('/show/<a>')
  10. def show(a, db):
  11. db.execute('SELECT * FROM table WHERE a > "%d"', (a,))
  12. return template('Hello {{name}}, how are you?', name=a)
  13.  
  14. run(host='192.168.1.19', port=8080, debug=True)
  15.  
  16. TypeError('show() takes exactly 2 arguments (1 given)',)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement