choose your language english spanish

All the incidences from Basque Country's
road network in just one click.

An accident? A traffic jam? A closed mountain pass becouse of the snow or the ice?

cupofwifi

Now beta available!

Want to know more about cupofwifi? Submit your e-mail address to get your beta key!

dajax library bottle

new dajax formula

Easy to use AJAX libraries for django.

Fast, easy and lightweight libraries to implement AJAX inside your django projects. Ready to use in 5 minutes.

dkpboard dkp system

A dragon-kill-point management engine, born from the hopes of some WoW players tired of obsolete and incomplete dkp systems.

At last, the option of choosing is a reality!

latest news
February 18, 2010

Here it is the new thecodefarm site!


It's a year since we published our "Web under construction" splash. As it is said shoemaker’s son always goes barefoot, that's what has happened to us, it's being a while but it here it is at last!

As you can see, we have integrated the web and the blog in the same site, so now you'll be able to know the latest news on the farm and you know better the team and the services we are working on.

For those who don't know us, thecodefarm is formed by four young entrepeneurs who are passionated by web development and all related staff. Here we leave you a photo so you can recognize us ;)

team

We seized the opportunity to create a blog manager, so we can generate as many blogs as we need for the services we offer by using the same system. We seized the smallest opportunity to learn and improve on what we do. We hope you like it.

This year gonna be a year full of news for thecodefarm, so keep in the loop!

We want to thank you all your interest in our project and the support we have received. Soon you'll discover the new services we have been working on, we hope you're soon enjoying them ;)

We are waiting for you at thecodefarm!

February 18, 2010

Translating in Django (Internationalization)


In such a a competitive market like the Internet, it's almost essential the fact of offering our products in the user's own language.

Translation process can result extremly boring, but thanks to Django and its support for i18n, this task is much more comfortable.

First of all, we need to install in our system gettext library, needed to compile the files with the translation strings.

We just have to download,

curl -O ftp://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz

Unzip it, and follow the usual steps:

./configure
make
sudo make install

While we are developing our application, we must import gettext (from django own utils).

from django.utils.translation import ugettext as _

We only have to invoke the function ...

February 18, 2010

Django Context Processors


Introduction

By using CONTEXT_PROCESSORS everytime we process a view, we'll include by default some specific vars to that template without reapeating it again and again.

By using the default context processors will achieve the following:

  • Avoid feeding on each view the same variables with the same code, getting rid of possible mistakes.
  • Getviews with less responsabilities.
  • DRY(Do not repeat yourself).

How?

We have to create a function called render_response. This function is in charge of doing the dirty work required and gather the context of our project with all the variables we need in each view.

We will create (as an example)util.py fileinto the our project's root. Inside the file we will include the following function:

def render_response ...