Advertisement
sriyanto

main.py

Oct 12th, 2022 (edited)
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. from flask import Flask, render_template, request, redirect, url_for, session
  2. import mysql.connector
  3. import re
  4. app = Flask(__name__)
  5. app.secret_key = "asdfghjkl12345fdsa_fdsakld8rweodfds"
  6. db = mysql.connector.connect(
  7.   host="remotemysql.com",
  8.   user="YOUR_USER",
  9.   passwd="YOUR_PASSWORD",
  10.   database="YOUR_DATABASE"
  11. )
  12. cursor = db.cursor(dictionary=True)
  13.  
  14. if db.is_connected():
  15.   print("Berhasil terhubung ke database")
  16. #PASTE THE ROUTES HERE#
  17. if __name__ == '__main__':
  18. # Run the Flask app
  19. #3306
  20.     app.run(host='0.0.0.0',debug=True, port=3306)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement