I have a Flask project, FlaskUserAuthentication which has a package with same name(FlaskUserAuthentication) and under that package there are two more packages namely API and Site. The following is the structure-
Both the __init__.py files under the API and Site packages are empty.
The following is the code from __init__.py file under main FlaskUserAuthentication package, .
from flask import Flask
from API.routes import api
from Site.routes import site
app = Flask(__name__)
app.register_blueprint(api)
app.register_blueprint(site)
and the run.py has following-
from FlaskUserAuthentication import app
if __name__ == '__main__':
app.run(debug=True)
However, when I enter http://127.0.0.1:5000/index after running the server, I get following error-
jinja2.exceptions.TemplateNotFound: index.html
When clearly I have the index.html file under Site=>templates=>Site folder. The following is my Site=>routes.py code-
from flask import Blueprint, render_template
site = Blueprint('Site', __name__, template_folder='templates') # updated
@site.route('/index')
def index():
return render_template('index.html')
@site.route('/login')
def login():
return render_template('login.html')
Can anyone please help.
P.S.: I have updated my solution and the question accordingly after some suggestions. Still same issue.

Siteandsite. It's OK on a case insensitive filesystem, but you'll hit problems if you every try to run your code on a case sensitive filesystem (e.g. on Linux).EXPLAIN_TEMPLATE_LOADING, i.e.app.config['EXPLAIN_TEMPLATE_LOADING'] = True.sin the name of template. The folder name where we store the flask template is strictly should betemplatesas per the flask documentation.