Skip to content

Instantly share code, notes, and snippets.

@kwikiel
Forked from anonymous/charter.py
Created September 5, 2014 11:42
Show Gist options
  • Save kwikiel/e780cdfe07626fe87869 to your computer and use it in GitHub Desktop.
Save kwikiel/e780cdfe07626fe87869 to your computer and use it in GitHub Desktop.
from bottle import get, post, request, run
from test2 import lovechart
@get('/login') # or @route('/login')
def login():
return '''
<form action="/login" method="post">
Username: <input name="username" type="text" />
Password: <input name="password" type="password" />
<input value="Login" type="submit" />
</form>
'''
@post('/login') # or @route('/login', method='POST')
def do_login():
username = request.forms.get('username')
password = request.forms.get('password')
if True:
return "<img src=http://bitatm.io/" +lovechart(username,password) + ">"
run(host='0.0.0.0', port=7070, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment