Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import *
- #from pymongo import MongoClient
- #import json
- app = Flask(__name__)
- # main interface
- @app.route("/")
- def main():
- return render_template('index.html')
- # Register Interface
- @app.route('/register/', methods = ['GET'])
- def register():
- #collection = db['userdb']
- firstname = request.form['firstname']
- lastname = request.form['lastname']
- username = request.form['username']
- password = request.form['password']
- #postData = { 'firstname': firstname, 'lastname': lastname,'username':username,'password':password}
- #json = json.dumps(postData)
- #try:
- #status = db.userdb.insert_one(postData).insert_id
- #except:
- #status = 'This user is already registerd'
- return 'This data works'
- if __name__ == "__main__":
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement