- Flask Framework Cookbook(Second Edition)
- Shalabh Aggarwal
- 47字
- 2021-06-24 13:57:57
How to do it...
Flask recommends a specific way of organizing static files in an application, as follows:
my_app/ - app.py - config.py - __init__.py - static/ - css/ - js/ - images/ - logo.png
While rendering this in templates (say, the logo.png file), we can refer to the static files using the following code:
<img src='/static/images/logo.png'>