Python X 🐍
42 subscribers
25 photos
2 videos
9 files
188 links
Download Telegram
Python X 🐍
livereload==2.5.1 Bug free version #random_module
from flask import Flask, request, render_template, url_for,send_file,send_from_directory
app=Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')

if __name__ == '__main__':
from livereload import Server
app.debug = 1
server = Server(app.wsgi_app)
server.serve()
#snippet |flask with livereload
livereload works only if it is a valid html file
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

</body>
</html>
Master Python & Build a Face Recognition App
With Zero Prior Coding Experience

Register for the ‘AI for India 1.0’ - The Online workshop that is first of its kind which will help anyone Master Python, Be it a school kid, fresh graduate or an experienced professional.

🔥417622 Participants Registered 🔥


🔰Enrollment Link:--
https://bit.ly/3eomCGJ

Enjoy❤️✌🏻👍🏻
Forwarded from Programmer Jokes
if u r using flask 2.0 u can use thing like.


@app.get('/name_of_route')
@app.post('/name_of_route')
def view_func:
if request.method == 'POST':
send_mail()
return "something"



Snippet given below works for 1.1.x as well 2.x


@app.route('/name_of_route', methods=['GET', 'POST'])
def view_func:
if request.method == 'POST':
send_mail()
return "something"


Source
Don't use input() in development.