Use flask_peewee get_object_or_404