Answers for "flask website"

5

Flask

pip install -U Flask
Posted by: Guest on April-13-2020
3

flask

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
Posted by: Guest on June-11-2020
0

flask

from flask import Flask
app = Flask('app')

@app.route('/')
def hello_world():
  return 'Hello, World!'

app.run(host='0.0.0.0', port=8080)
Posted by: Guest on September-15-2021
2

flask

Flask is a Python framework for web development.

When creating simple static sites, there is no need to use backend frameworks.
However, when creating complex and large sites that are backend heavy,
you will want to use a backend framework. Currently, the 2 Python frameworks
that are the most useful to learn are Flask and Django.

Flask:
Micro and light-weight framework that is easy to learn.

Django:
Complex, full-stack framework that is extremely powerful.

For smaller projects, Flask will work. However, for large ones, you might
consider learning Django. I suggest you learn Flask first and then Django.

Additionally, considering learning Node JS because even though it is in
Javascript, it is extremely popular.
Posted by: Guest on March-31-2021
0

flask app

# -*- coding: utf-8 -*-
# Librarys
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy

# Variables
app = Flask(__name__)

# Settings
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = 'secret'



app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.sqlite'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy()
db.init_app(app)



# Views
@app.route('/', methods=('GET', 'POST'))
def index():
    return render_template('name.html')


# Run
if __name__ == '__main__':
    app.run()
Posted by: Guest on September-02-2021
0

flask

$ flask run --host=0.0.0.0
Posted by: Guest on May-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language