Archive for the ‘ Python ’ Category

Inspired by this article I decided to find out if the same technique can be exploited in my current project which is developed in django.

My first problem was to come up with a viable cache key scheme since simply using the full request URI as suggested in the article wouldn’t work for me because my site renders a different version of a navigation menu depending on the authentication state of current the user. After weighing in the advantages and disadvantages between the super clean variant of factoring the session cookie and all other cookies into the memcached key and a less heavy weight method that would only append a server supplied abstract “page version” field to the request URI, I went for the latter. My resulting nginx virtual host config was looking like this:

[More]

About a year ago I’ve switched over to IntelliJ as my primary Java IDE. When I began to dabble a bit in Django a few days ago, I realized that IntelliJ had me spoiled when it comes to Editor Features – especially when working with Javascript and HTML files. Notepad++ - although a great text editor on its own right - simply didn’t cut it for me for web development.

When I tried opening my Django files in IntelliJ I had to realize that IntelliJ needs a project context for opening a file. Even for a simple html file. Fortunately the solution was pretty straight forward. Navigate to your Django project root directory and create a new file .project. Some of you have guessed it: we are pretending to be Eclipse. Open the file in a text editor and paste the following snipped into it:

<?xml version=”1.0″ encoding=”UTF-8″?>
<projectDescription>
<name>myproject</name>
<comment></comment>
<projects></projects>
</projectDescription>

Edit the <name> tag value and change it to your liking.

[More]