What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-08 22:20:07
how to check which submit button is clicked in flask wtf
from flask import Flask, render_template, redirect, url_for from flask_wtf import Form from wtforms import SubmitField app = Flask(__name__) app.secret_key = 'davidism' class StatsForm(Form): user_stats = SubmitField() room_stats = SubmitField()... Add solution -
Python 2021-10-08 21:19:12
flask page
# Extremely simple flask application, will display 'Hello World!' on the screen when you run it # Access it by running it, then going to whatever port its running on (It'll say which port it's running on). from flask import Flask app = Flask(__name__) @a... Add solution -
Python 2021-10-08 15:11:12
telegram chat bot using flask
import re from flask import Flask, request import telegram from telebot.credentials import bot_token, bot_user_name,URL global bot global TOKEN TOKEN = bot_token bot = telegram.Bot(token=TOKEN) app = Flask(__name__) @app.route('/{}'.format(TOKEN), met... Add solution -
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