Closed anthonyjpesce closed 7 years ago
Interesting idea. I hadn't considered that use case before.
As I think about it, maybe there isn't a need for the distinction between the data folder and the static folder. I could imagine deprecating the data folder entirely and having it draw in files from the static folder to the context instead.
I wonder if we could simply require a "full path" to the data file like "data/results.csv" or "static/results.csv" and trust the user to figure out where they want to put it. If you want it live in static folder, just go for it.
I like that idea, and the app is just less opinionated about your directories which is (usually) kind of nice
Shipping this now.
Half baked idea, but I have a reason today to want to import a JSON file as context data I also want to have built from the static directory.
You could add a check here: https://github.com/datadesk/django-bigbuild/blob/master/bigbuild/models/pages.py#L139
Alternate idea would be to have a flag to bake out the data files to make them available publicly (similar to what we did on the graphics site with the .json extension).