I've recently reorganised my project folders and I've put my static folder inside a new view folder.
/view
- /static
- /templates
main-controller.py
When I call the Flask app in main-controller.py I define the new view folder in the constructor:
app = Flask(__name__, root_path='view/')
When I start the Flask server it renders the template page inside templates however doesn't render anything from the static folder, receiving page errors like:
Failed to load resource: style.css:1
the server responded with a status of 404 (NOT FOUND)
Failed to load resource: script.js:1
the server responded with a status of 404 (NOT FOUND)
Which are called in session.html with:
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/style.css') }}">
and
<script type="text/javascript" src="{{ url_for('static', filename='script.js') }}"></script>
Why is it failing to find the static folder but finding the templates folder fine?