I've been reusing this pattern for Flask applications and decided to stop repeating myself.