I\'ve locally built static Sphinx documentations (using make html
).
I wish now to integrate the Sphinx files into my webapp that runs with Flask. From the
In some cases you do not want to expose your docs to all users so configuring at the Apache or Nginx level is not an option. The following worked for me:
@app.route('/docs', defaults = {'filename': 'index.html'})
@app.route('/docs/')
@login_required
def web_docs(filename):
path = os.path.join('docs/html', filename)
return app.send_static_file(path)