Archive for tag "python"
Google App Engine
Today I launched my first Google App Engine site Ross Gload Is Everywhere. So far I’m pretty impressed with what Google has to offer. The coding part is plan old Python with some basic framework tools. The ORM is usable, more on that in a minute and the development environment is what you would except. The shinny star IMHO is deployment and management. With a simple command in Terminal your fresh code is deployed and running live. No messing with SSH, version control, stopping or restarting services. I dig it. Plus they give you nice dashboard to view log files, request information and lot more. Really other hosting companies could learn a thing or two from the dashboard.
Setting and deleting cache in Django with tags
The Django cache system is real help when you need to keep your site as fast as possible. It offers multiple back-ends and is super easy to get started using. I just wish it had the ability to tag content when you are setting it in the cache. If you could do that then you could do bulk deleting of content based on tags. One use-case that comes up again and again for me is caching paginated results. If you have blog-entry1-page1 and blog-entry1-page2 both stored in the cache and want to delete them when a new entry is added what do you do? It’s hard if not impossible you know which paged set is currently in cache and we need to know the keys in order to delete them.
I searched and searched for a solution to this problem with not much help from google. I did find this post by Eric Florenzano which is close to the approach I took, but I wanted something more generic. So I decided to add two new methods cache.set_with_tags and cache.delete_by_tags to whatever cache backend you are using. Just to note this is only useful if you intend to utilize the low-level cache framework.






