How do I fix an endpoint error with flask blueprints

前端 未结 1 1054
Happy的楠姐
Happy的楠姐 2021-01-28 22:05

I am learning flask with blueprints and I have the following code example:

from flask import Flask, render_template, Blueprint, g

bp = Blueprint(\'language\', _         


        
1条回答
  •  花落未央
    2021-01-28 22:32

    Looks like you are missing the Blueprint name (language) in your url link:

    From here:

    bp = Blueprint('language', __name__, url_prefix='/', static_folder='static')
    

    So your link will need to be appended:

    English
    

    I would also suggest naming it something different so it doesn't conflict with any other naming convention you might have.

    0 讨论(0)
提交回复
热议问题