What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-30 20:54:03
Flask Download a File
from flask import Flask from flask import send_file app = Flask(__name__) @app.route('/download') def downloadFile (): #For windows you need to use drive name [ex: F:/Example.pdf] path = "/Examples.pdf" return send_file(path, as_att... Add solution -
Python 2021-09-28 20:12:02
flask mongoengine configuration
'''Basic setup can be done by defining MONGODB_SETTINGS on app.config and creating a MongoEngine instance.''' from flask import Flask from flask_mongoengine import MongoEngine app = Flask(__name__) app.config['MONGODB_SETTINGS'] = { "db": &... Add solution -
Javascript 2021-09-19 23:56:02
flask server js return from folder
from flask import Flask, request, send_from_directory # set the project root directory as the static folder, you can set others. app = Flask(__name__, static_url_path='') @app.route('/js/<path:path>') def send_js(path): return send_from_direct... Add solution -
Python 2021-09-16 05:35:02
python simple web app
# Core web app using flask # Download flask if you haven't from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' if __name__ == '__main__': app.run() # If you want to put this on the internet, u... Add solution