So I'm fairly new to Flask, but now I'm trying to use it for a project in a team, and, as all good projects should, we wanted to have a good folder structure to keep everything nice, neat and organised however we keep running into problems with using subfolders within the template folder.
This is the way we want our structure to be:
- src
- templates
- About
- about.html
- about.css
- about.js
- Index
- index.html
- index.css
- index.js
- About
- templates
Where About would be a classic about us page, and profile a classic profile page. However we're really confused on how to actually route this - for example we don't understand why something like this doesn't work...
from flask import Blueprint, render_template, request, flash, jsonify
import json
views = Blueprint('views', __name__)
@views.route('/', methods=["GET", "POST"])
def index():
return render_template('Index/index.html')
@views.route('/about', methods=["GET", "POST"])
def about():
return render_template('About/about.html')
We're stumped here and would really appreciate any help that you could give!