I have establish the flask project,And it can run successfully,but I want to put my images directory in my web root path,make the images can be showed by visiting url http://mywebsite.com/images/test.jpg
I have tried to put the images dir under the static dir and under the website dir and under the app dir,they are both no working.
I search google ,and put the images dir under static dir try
@app.route('/images<path:path>')
def return_images(path):
return send_from_directory(os.path.join(app.root_path,'static/images'),path)
then visite http://mywebsite.com/images/test.jpg it's no working..
I am a newer for python flask,so How to server static file in python flask?