Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask_mysqldb import MySQLdb
- def connection():
- conn = MySQLdb.connect(host="localhost",
- user = "root",
- passwd = "@passwd",
- db = "BLOG")
- c = conn.cursor()
- return c, conn
- from flask import Flask, render_template, flash, request, url_for, redirect
- from . import content_management
- from dbconnect import connection
- import sys
- TOPIC_DICT = content_management.Content()
- app = Flask(__name__)
- @app.route('/')
- def homepage():
- return render_template("main.html")
- @app.route('/register/', methods=["GET","POST"])
- def register_page():
- try:
- c, conn = dbconnect.connection()
- return("okay")
- except Exception as e:
- return(str(e))
Add Comment
Please, Sign In to add comment