Google News
logo
Flask - Interview Questions
How to serve static files in Flask?
Static files should be added to the flasks/static directory and then the files are referenced in the HTML to serve the static files. Static files such as CSS and JavaScript acts as a template and adds more functions to your web application. All the static files are added to the flask/static directory and referenced by the following line to serve it.
//referencing static files in the flask
url_for(‘static’, filename=’static_file_name’)

 

Advertisement