I'm using Flask with the application factory pattern, so my entire app is contained within a function.
This creates the issue, that Sphinx doesn't document my views and methods in the app, as they're "hidden" inside the factory.
Ideas to fix this?
(Ideas other than "put all views in a blueprint", although that's a great modular approach)
If you don't want to use blueprints then you could move all the view functions outside of the app factory function and just have the routing done in the factory using Flask.add_url_rule(). That way the view functions will be external and visible to Sphinx.
Likewise, if you have any classes that you define inside the factory function put them outside and only instantiate them in the factory.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With