following tutorial flask loading jquery. http://flask.pocoo.org/docs/patterns/jquery/ write bellow code in index.html resides in template folder , outside of template have test.py file
<img src="start.jpeg" alt="start"/>
start.jpeg available in template folder index.html available. when run python test.py file i'm getting bellow error
127.0.0.1 - - [11/jul/2013 19:27:45] "get /start.jpeg http/1.1" 404
even faced same problem jquery file. if download jquery.js file , put in js folder
src="js/jquery.js"
instead of importing google cdn file i'm getting same error. please me.
you can use url_for
in template, the recommended way access static files flask.
put image in:
/static/start.jpeg
and use:
<img src="{{ url_for('static', filename='start.jpeg') }}" alt="start"/>
Comments
Post a Comment