Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

flask - Blueprint object has no attribute config

i keep getting this error when ever i try to run my flask web app AttributeError: 'Blueprint' object has no attribute 'config'
i have try many tutorial online still not working.

so here is my code blow

from __future__ import unicode_literals
    from flask import Blueprint
    from flask import flash, current_app
    from flask import g
    from flask import render_template
    from flask import url_for
    from werkzeug.exceptions import abort
    import requests
    from hashlib import md5
    from flaskr.auth import login_required
    from flaskr.db import get_db
    import subprocess
    import youtube_dl
    import os
    import sys
    from flask import Flask, render_template, request, send_file, redirect, jsonify
    from subprocess import check_output, call
    from os import chdir as cd
    from re import match
    from flask_mysqldb import MySQL
    
    
    
    
    bp = Blueprint("home", __name__)
    
    mysql = MySQL(bp)
    
    
    #Enter here your database informations 
    bp.config["MYSQL_HOST"] = "localhost"
    bp.config["MYSQL_USER"] = "root"
    bp.config["MYSQL_PASSWORD"] = ""
    bp.config["MYSQL_DB"] = "artist_database "
    bp.config["MYSQL_CURSORCLASS"] = "DictCursor"
    
    
    
    
    @bp.route("/")
    def index():
        return render_template("home.html")
    
    
    @bp.route("/auth.login")
    def login():
        return render_template("login.html")

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...