is flask open source
Yes, the source code is at
https://github.com/pallets/flask
is flask open source
Yes, the source code is at
https://github.com/pallets/flask
python basic flask web
from flask import Flask
app = Flask(__name__)
#__name__ is passed as the paremater
@app.route('/')
#when the home page is open
#e.g https://yourwebsite/
def home():
return "Text in website"
@app.route('/about/')
#when the about page is open
#https://yourwebsite/about/
def about():
return "About Text"
#when running your file the file name is __main__
#whatever you name it
#but when importing the file the name will be the name you named it
#so to run this file without importing we passed in the paremater __name__
#which is equal to __main__
#so we have to make sure it runs only from this file
if __name__ == "__main__":
app.run()
#open your browser and write
#127.0.0.1:5000
#to open your website
#you can change the host by passing in the host as an str
#in the app.run()
#e.g app.run("host")
#and you can also change the port
#e.g app.run("host",8464)
#this will open on host:8464
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us