sevbo Flarum's frontend is rendered via backend templates. In addition to that, Flarum uses Mithril.js components to render the frontend, since it's a SPA (Single Page Application). It doesn't contain any raw HTML, AFAIK
Because of this setup, it would require a great amount of work to just swap Flarum's backend with a Python one. May I ask why would you want to do that? Because in my opinion, you're reinventing the wheel there - Flarum already has a great codebase that can be greatly extended via extensions, should you be missing a feature.