Archive for tag "python"

12Aug

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.

read more

11Apr

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.

read more

About Steps and Numbers
avatar

Steps and Numbers is the personal blog of web developer/designer Sean Brant. I enjoy coding and designing wonderful user experiences for the web. I spend my spare time hanging out in the beautiful city of Chicago, coding random projects most of which never see the light of day, and attempting to resurrect my failed carrier as a rock musician. You can contact me if you want and I’ll try and respond.

Flickr Photos
IMG_0970.JPG
IMG_0991.JPG
IMG_1002.JPG
IMG_0990.JPG
IMG_1015.JPG
IMG_1001.JPG
Search
Feeds
Post, Links, and Quotes
Just Posts
Just Links
Just Quotes