text: # from flask import Flask, render_template,json, request
  from flask_debugtoolbar import DebugToolbarExtension
  # from flask.ext.mysql import MySQL
  # from werkzeug import generate_password_hash, check_password_hash
  
  # app = Flask(__name__)
  # mysql = MySQL()
   
  # # MySQL configurations
  # app.config['MYSQL_DATABASE_USER'] = 'jay'
  # app.config['MYSQL_DATABASE_PASSWORD'] = 'jay'
  # app.config['MYSQL_DATABASE_DB'] = 'BucketList'
  # app.config['MYSQL_DATABASE_HOST'] = 'localhost'
  # mysql.init_app(app)
  
  
  # # the toolbar is only enabled in debug mode:
  # app.debug = True
  
  # # set a 'SECRET_KEY' to enable the Flask session cookies
  # app.config['SECRET_KEY'] = '<replace with a secret key>'
  
  # toolbar = DebugToolbarExtension(app)
  # @app.route("/")
  # def main():
  #     return render_template('index.html')
  
  # @app.route('/showSignUp')
  # def showSignUp():
  #     return render_template('signup.html')
  
  # @app.route('/signUp',methods=['POST'])
  # def signUp():
   
  #     # read the posted values from the UI
  #     _name = request.form['inputName']
  #     _email = request.form['inputEmail']
  #     _password = request.form['inputPassword']
   
  #     # validate the received values
  #     if _name and _email and _password:
  #         return json.dumps({'html':'<span>All fields good !!</span>'})
  #     else:
  #         return json.dumps({'html':'<span>Enter the required fields</span>'})
  
  # if __name__ == '__main__':
  #     app.run()
  
  from flask import Flask, render_template, json, request
  from flask.ext.mysql import MySQL
  from werkzeug import generate_password_hash, check_password_hash
  
  mysql = MySQL()
  app = Flask(__name__)
  
  # MySQL configurations
  app.config['MYSQL_DATABASE_USER'] = 'root'
  app.config['MYSQL_DATABASE_PASSWORD'] = 'imack'
  app.config['MYSQL_DATABASE_DB'] = 'Bucketlist'
  app.config['MYSQL_DATABASE_HOST'] = 'localhost'
  mysql.init_app(app)
  
  # the toolbar is only enabled in debug mode:
  app.debug = True
  
  # set a 'SECRET_KEY' to enable the Flask session cookies
  app.config['SECRET_KEY'] = '<replace with a secret key>'
  
  toolbar = DebugToolbarExtension(app)
  
  @app.route('/')
  def main():
      return render_template('index.html')
  
  @app.route('/showSignUp')
  def showSignUp():
      return render_template('signup.html')
  
  
  @app.route('/signUp',methods=['POST','GET'])
  def signUp():
      try:
          _name = request.form['inputName']
          _email = request.form['inputEmail']
          _password = request.form['inputPassword']
  
          # validate the received values
          if _name and _email and _password:
              
              # All Good, let's call MySQL
              
              conn = mysql.connect()
              cursor = conn.cursor()
              _hashed_password = generate_password_hash(_password)
              cursor.callproc('sp_createUser',(_name,_email,_hashed_password))
              data = cursor.fetchall()
  
              if len(data) is 0:
                  conn.commit()
                  return json.dumps({'message':'User created successfully !'})
              else:
                  return json.dumps({'error':str(data[0])})
          else:
              return json.dumps({'html':'<span>Enter the required fields</span>'})
  
      except Exception as e:
          return json.dumps({'error':str(e)})
      finally:
          cursor.close() 
          conn.close()
  
  if __name__ == "__main__":
      #app.run(port=5002)
      app.run()