set datetime as default current timestamp for flask model


Try this it will work guaranteed 😀

created_on = db.Column(db.DateTime, server_default=db.func.now())

Advertisement