Tag Archives: Flask
How to Auto Generate & Deploy Docs for a Flask App with Sphinx AutoAPI on GitHub Pages
This post assumes you have all your Flask blueprints and other modules in the /app directory. If not, revise these snippets accordingly. 1. Install the Sphinx, with a theme and the autoapi extension: pip install sphinx sphinx-rtd-theme sphinx-autoapi 2. Create and navigate into the docs directory: mkdir docs cd docs 3. Run Sphinx quick start:…
Splitting Flask Routing Functions into Different Modules
We can put group-related routing functions into separate modules to keep a big project organized and avoid having one long views.py in your project. For example, we can take the login and sign-up-related functions from views.py and move them into a module named auth.py. In auth.py, we need to register a new blueprint: In auth.py:…