Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. from flask import *
  2. #from pymongo import MongoClient
  3. #import json
  4. app = Flask(__name__)
  5.  
  6. # main interface
  7. @app.route("/")
  8. def main():
  9. return render_template('index.html')
  10.  
  11. # Register Interface
  12. @app.route('/register/', methods = ['GET'])
  13. def register():
  14. #collection = db['userdb']
  15. firstname = request.form['firstname']
  16. lastname = request.form['lastname']
  17. username = request.form['username']
  18. password = request.form['password']
  19. #postData = { 'firstname': firstname, 'lastname': lastname,'username':username,'password':password}
  20. #json = json.dumps(postData)
  21. #try:
  22. #status = db.userdb.insert_one(postData).insert_id
  23. #except:
  24. #status = 'This user is already registerd'
  25. return 'This data works'
  26.  
  27. if __name__ == "__main__":
  28. app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement