1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| #!/usr/bin/python
# -*- coding: utf-8 -*-
from bottle import Bottle, run, view, request, static_file, route
app = Bottle()
runners = ['nmap', 'vmware']
@route('/htdocs/:path#.+#', name='static')
def static(path):
return static_file(path, root='.')
@app.route('/')
@view('test.tpl')
def test():
return {'plageip': '', 'password': '', "title": "Titre de page!", 'runners': runners, 'runner': None} #Je voudrais avoir ici return {"title": "Titre de page!", 'runners': runners}
@app.route('/', method='POST')
@view('test.tpl')
def hello():
plageip = request.forms.get('plageip')
runner = request.forms.get('pack[]')
return dict(plageip=plageip, runner=runner, runners=runners, title="Nouvelle page!") #Et là return dict(plageip=plageip, runner=runner)
run(app, host='0.0.0.0', port=8080, debug=True, reloader=True) |
Partager