default in flask model value code example
Example 1: default argument in flask route
@user.route('/<user_id>', defaults={'username': None})
@user.route('/<user_id>/<username>')
def show(user_id, username):
pass
Example 2: sqlalchemy db.column default value
Column('version', Integer, default=1)
Example 3: default flask app
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Flask'