Advertisement
sriyanto

main_route

Oct 12th, 2022
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from flask import Flask, render_template, request, redirect, flash, url_for, session
  2. import mysql.connector
  3. from werkzeug.security import check_password_hash, generate_password_hash
  4. app = Flask(__name__)
  5. app.secret_key = "asdfghjkl12345fdsa_fdsakld8rweodfds_s"
  6. db = mysql.connector.connect(host="remotemysql.com",user="YOUR_USERNAME", passwd="YOUR_PASSWORD", database="YOUR_DATABASE")
  7. cursor = db.cursor()
  8.  
  9. if db.is_connected():
  10.   print("Berhasil terhubung ke database")
  11. # Paste here
  12. if __name__ == '__main__':
  13.     app.run(host='0.0.0.0',debug=True, port=3306)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement