I’m working on a data-heavy Django site. In general, it serves as a metadata store for the analysis of a lot of marketing campaigns.
Observable Framework is a self-hostable static page generator for data analysis (from Mike Bostock, who brought us d3, etc.).
Assuming I install the Observable toolchain and have it successfully creating static html analytical reports, what I would like to do is have Django be able to serve these pages so that I can integrate them with my main site. As an example use case, imagine browsing through a list of marketing campaigns on the Django site and then being able to click a “see report” link and view the page generated by the Observable Framework.
What would be the best way to go about this? Is it reasonable to wrap these pages in Django? I would like to do that to guarantee that I can use the same auth that I use in the Django app (corporate SSO with various permissions set in Django). Or would it be better to consider serving them separately and having Django simply link to them?
One question that a situation like this raises is whether or not those static pages are complete pages (full html head/body with css and js file references) or if they’re “body only”.
The type of integration you describe is relatively easy if they’re page fragments. You can use them as data in the body in a template being rendered. (I’ve done that a couple times with Jekyll-generated pages.)
However, if they are complete pages with their own infrastructure, then it’s going to be easiest to serve them outside Django. This does not mean that you are unable to restrict access to them using your Django infrastructure. In this latter case, you would set these files up in a manner similar to your static files. (See the remark at Show external folder html content in django - #2 by KenWhitesell for some ideas in that area.)