I have an app i am making and i would like to hold all python code, css and js assets inside a folder and name it appropriately so that one person can do a complete module,test it and upload it to the main project.
I am planning to have something like this structure
index.py
global_assets
global_classes
global_html_components
home(assets(js,css,images),home.html,home_widget_1.html,home_widget_2.html,home_widget_3.html,controller.py,model.py)
services
products
dashboard
I have this script.py
from flask import *
app = Flask(__name__)
@app.route('/user/<uname>')
def message(uname):
return render_template('message.html',name=uname)
if __name__ == '__main__':
app.run(debug = True)
and message.html
<html>
<head>
<title>Message</title>
</head>
<body>
<h1>hi, {{ name }}</h1>
</body>
</html>
I want my app to have one entry at index.py such that i can visit urls of any of my modules and the page displays for instance in the code above
http://localhost:5000/home/user/admin
where home is one of the folders i named above.
Is this kind of structure possible in flask?