Saturday, November 12, 2011

Fabric deployment

Having played with Capistrano before, I suddenly had an urge to find its Pythonic alternative. After few google searches, I stumbled upon Fabric. It's basically a "python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks". Spent few minutes trying to write functions to deploy Django applications to my Linux server and I have to say, Fabric's API is really easy to use, very customizable (it's as easy as wrapping up your shell commands in a python function) and more importantly it has Django integration which I'm gonna need the most. Having said all these, here's the video demo I recorded while messing around with Fabric, enjoy:

P/S: django-nose, nosegrowl2 and tdaemon were used in order to show notification of testing results (just FYI)


Saturday, November 5, 2011

Fatal error: Call to undefined function _make_cat_compat()

If you have the following error after uploading your WordPress, and re-uploading category-template.php didn't work, you could try pasting this function at the of the file.

function _make_cat_compat( &$category ) {
    if ( is_object( $category ) ) {
        $category->cat_ID = &$category->term_id;
          $category->category_count = &$category->count;
          $category->category_description = &$category->description;
          $category->cat_name = &$category->name;
          $category->category_nicename = &$category->slug;
          $category->category_parent = &$category->parent;
      } elseif ( is_array( $category ) && isset( $category['term_id'] ) ) {
          $category['cat_ID'] = &$category['term_id'];
           $category['category_count'] = &$category['count'];
          $category['category_description'] = &$category['description'];
          $category['cat_name'] = &$category['name'];
          $category['category_nicename'] = &$category['slug'];
          $category['category_parent'] = &$category['parent'];
      }
}