mvc-flask
mvc-flask copied to clipboard
jinja2.exceptions.TemplateNotFound: index.html
Hi I cloned your code and while trying to use the example app I am getting this error
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html
I tried creating a templates folder under the example directory and copied contents from the view folder to it. still the same error
Appreciate your help
Hi @bjenmonk ,
change the folder name templates
to views
. let me know if i helped you
Hi Marcuxyz tried that but didn't worked so I fixed it by changing def create_app(): app = Flask(name, template_folder='views')
Hey :)
You dont need configure the template_folder
param, because, we will make this for you
https://github.com/marcuxyz/mvc_flask/blob/0c9a463a0744ff6ca072ac2eb5cf89bd25d0504d/mvc_flask/init.py#L14
Please, see this image:
is your directory like this?
yes, the folder structure is like that. I removed the template_folder='views' and now it is working. not sure why. but thanks for your time
You are welcome! :)
Actually, its not working still have same problem.
app = Flask(name) instead of this only you can write as mentioned below.
app = Flask(name, template_folder='templates')
//here templates is the folder name , check your folder name and write it inside single quotes.
this one worked for me.
yes, the folder structure is like that. I removed the template_folder='views' and now it is working. not sure why. but thanks for your time
please shared this repository, i will go review
Hi there! To solve TEMPLATE NOT FOUND ERROR in Flask I added "template_folder". So in short you get this:
from flask import Flask, render_template
app=Flask(__name__, template_folder='template')
@app.route('/')
def main():
return render_template('home.html')
app.run(debug=True)
Hi there! To solve TEMPLATE NOT FOUND ERROR in Flask I added "template_folder". So in short you get this:
from flask import Flask, render_template app=Flask(__name__, template_folder='template') @app.route('/') def main(): return render_template('home.html') app.run(debug=True)
Hi @kssy-ks . Fines? please shared this repository, i will go review.
I tested here, its work for me :) see:

Sorry to say but this bug is really annoying. I tried all the suggested solutions but still face the same issue
Sorry to say but this bug is really annoying. I tried all the suggested solutions but still face the same issue
Can you share this repository?
app = Flask(name) instead of this only you can write as mentioned below.
app = Flask(name, template_folder='templates') //here templates is the folder name , check your folder name and write it inside single quotes. this one worked for me.
i try for a hour ....it works for me!!!!!!!!!!! thanks a lot
People, if you don't to describe the issue, it's hard to understand!!!!!
PLEASE, SEND YOUR PROJECT TO GITHUB AND SHARE FOR ME
if your project isn't open source, please, create one and share.
Hello @marcuxyz , I also facing the same issue can you please help me with this.
Hello @ajanujaj , It looks like it doesn't use the mvc-flask extension
📦app ┣ 📂resources ┃ ┣ 📂static ┃ ┃ ┣ 📂css ┃ ┃ ┃ ┣ 📜login.css ┃ ┃ ┃ ┣ 📜register.css ┃ ┃ ┃ ┗ 📜style.css ┃ ┃ ┣ 📂img ┃ ┃ ┗ 📂js ┃ ┃ ┃ ┣ 📜app.js ┃ ┃ ┃ ┣ 📜login.js ┃ ┃ ┃ ┗ 📜register.js ┃ ┗ 📂templates ┃ ┃ ┣ 📜about.html ┃ ┃ ┣ 📜index.html ┃ ┃ ┣ 📜login.html ┃ ┃ ┣ 📜register.html ┃ ┃ ┗ 📜services.html ┣ 📂__pycache__ ┃ ┣ 📜app.cpython-312.pyc ┃ ┣ 📜model.cpython-312.pyc ┃ ┣ 📜routes.cpython-312.pyc ┃ ┗ 📜__init__.cpython-312.pyc ┣ 📜app.py ┣ 📜model.py ┣ 📜routes.py ┗ 📜__init__.py
Cobalah mas ireng! in routes.py ->
app = Flask(__name__, static_folder='resources/static', template_folder='resources/templates')
in html ->
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
<script src="{{ url_for('static', filename='js/login.js') }}"></script>
Hi I having the same issue on mine . @marcuxyz can you help me
@iankb26 you can send code to github and send me the link? Did you leave the code structure the same as this image? https://github.com/marcuxyz/mvc-flask/issues/9#issuecomment-1498403553
@marcuxyz https://github.com/iankb26/User-Interface Here's the link let me know what you think and I'm trying to use mvc method like what you showed on the previcus comments. Thanks for the help marcus :) ,
@iankb26 Have you sent the correct code? I have not found the mvc-flask
library.
I also have the same problem, can someone help me? https://github.com/thanhhungk57/Mongodb-connect-fastapi.git
@thanhhungk57 this project uses the fastapi
project. mvc-flask only works on Flask. https://flask.palletsprojects.com/
hi @marcuxyz
i am also facing the same issue i have tried everything using template folder variable changing the name of the folder but facing the same issue
Hi @supreetbajaj2004 ,
Have you installed and used the extension: MVC-flask
? In your images, it looks like that doesn't. Please visit the documentation https://marcuxyz.github.io/mvc-flask/
I will thanks for help@marcuxyz
Such a long discussion for a simple bug. Why is that