'Flask relative path to css for sub Apps
i would like to ask you how to figure out paht fot static folder for sub apps in Flask. I have one pool OpenCv with two apps (App1 and App2). Both apps working fine, i can load templates without any problems, but struggle with css. I tried many was but without any results. Just if static folder in in pool level (OpenCv) then css works. Thx for any help
app.py
from flask import *
app = Flask(__name__)
@app.route('/App2/')
def home():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug = True,threaded=True )
index.html
<html>
<head>
<meta charset="UTF-8">
<title>Message</title>
<link rel="stylesheet" href="{{ url_for('static', filename='App2/static/css/style.css') }}">
</head>
<body>
<h1>app2</h1>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
