Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Introducing django-bakery, helpers to bake out your site as flat files (latimes.com)
12 points by palewire on March 13, 2012 | hide | past | favorite | 4 comments


Nice work.

I'd tinkered with the same thing and actually came up with https://github.com/mtigas/django-medusa but never got it clean/stable enough to talk about (though it now runs my blog to S3 where it's served now). Some of the same ideas, but very different execution of the concept. (Up to the apps to define a `renderer` to generate a list of URLs to render; management command then abuses the test client to fetch each one, which also allows storing header information like content-type when using a backend like S3.)

Baking in the build bits as part of the generic class-based views = very cool. Pun intended.


That's really interesting. I suspect your system allows quite a bit more flexibility.


Any criticism or feedback is appreciated. Thanks.


I am sorry that I don't have an implementation of a Django-site that would leverage this, but it is a truly awesome idea. Where I work, we have a site that is managed by Wordpress. We serve it from Akamai so we have to flatten it out. Our methodology boils down to a sitemap and a wget script that pulls every view. We then lftp the flattened version out to Akamai. This process is time-intensive, but it yields terrific results that you bulleted out in the article.

Oh, how I would love this approach with Django! Since what we have isn't broken, no reason to fix it as our focus is elsewhere at the moment.

The biggest gotcha can be the lack of server-side logic. Imagine orchestrating a time-sensitive, multi-phase event visible to over two million users by uploading a JSON file manually at appropriate times to Akamai and relying on JavaScript to handle redirects/DOM changes for evolving views. It takes being creative with the baked approach, but it can very well be done!!!

(Source: Had to make it happen!!)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: