python - How to use sphinx with flask? -


the documentation of project relies on sphinx generated autodoc. purpose of project provide prediction service.

i wrap service flask. , can accessed through endpoint

localhost:5000/predict?... 

i want integrate documentation flask, can accessed through endpoint in same application object like

localhost:5000/doc 

how achieve elegantly ?

sphinx-doc generated files static, have send statically.

following send_file documentation, like:

@app.route('/docs', defaults={'filename': 'index.html'}) @app.route('/docs/<path:filename>') def documentation(filename):     return flask.send_from_directory(         app.config['upload_folder'],         filename     ) 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -