Archive for February, 2009

Django File Upload Handling Examples

Wednesday, February 18th, 2009

I have been working on a multi-user blogging and publishing platform using Django 1.0 lately. Naturally this requires the backend to be able to handle file uploads. A lot of things have changed from Django 0.96 which I am still using on some legacy code. One of those changes is the way Django 1.0 handles file uploads. Most of the changes done were made to allow Django apps to handle large files without soaking up too much memory.

So what has changed? The most visible change is that there are now at least two separate API’s that you have to work with. You have the File API and the Storage API. The File API which exposes the File class provides a thin wrapper around Python file objects. The Storage API, on the other hand, exposes a base class Storage that you can use to implement custom storage facilities. There is another API that provides FileUploadHandler. This will allow you to customize the way Django handles the uploaded files in their “raw” form. For most purposes, the File and Storage API will suffice.

This post is meant to supplement the information found in the “Handling Uploaded Files” section of the Django File Uploads documentation. You will still need to refer to documentation.

(more…)

Hectic Capiznon Bloggers

Sunday, February 8th, 2009

If you came here via Google Search for the keywords “Hectic Capiznon Bloggers” then this rant is for you. Let me guess, you are part of this “SEO Contest” to push this particular set of keywords up in search result rankings. Think about what you are doing for a second. Do one better and ask yourself, “What am I doing? Is this SEO or is this spam?”

What is SEO? SEO stands for Search Engine Optimization. What it all boils down to is that you use optimization techniques so that your website shows up first in the search results when someone searches for a particular keyword using Google or Yahoo search. It is a legitimate practice that is not only allowed, it is also encouraged. Google engineers like Matt Cutts encourage good Search Engine Optimization techniques and practices because it makes Google Search better at providing people with relevant search results. The problem lies in some shady “SEO techniques” that subvert the system.

Personally I have no problem with SEO and SEO Contests in general. I have used “white hat” Search Engine Optimization techniques when building CMS-enabled websites. The new Django-based multi-user blog and content publishing platform I am working on has features geared specifically towards SEO. However, I do have a gripe against people who use shady practices for “SEO”. Practices such as link bombing, keyword stuffing, spamdexing, content scraping, and cloaking are not only bad form, they are harmful.

Most SEO Contests I have seen used a set of intentionally nonsensical keywords. The organizers of events who use nonsense keywords such as “Nigritude Ultramarine” and “Seraphim Proudleduck” understand that the actions of their contestants have the potential to pollute search engine indexes. There are some organizers who fail to grasp the importance of keeping search engine indexes free from bogus search results and intentionally use valid, and sometimes commonly searched, keywords for these contests.

“SEO Contests” which use valid keywords like this one for Hectic Capiznon Bloggers are particularly bad. I am not sure if the organizers of this event know it but the following keywords will also match “capiznon”, “hectic blogger”, “capiznon blogger”, “capiznon blog”, “capiznon blogger”, “hectic capiznon” and a few other permutations. From what little information that I have found on this particular contest, there does not appear to be any set of rules as to what SEO techniques are allowed/disallowed (if there are, please point them out in the comments). So what is stopping the participants of this contest from using bad “SEO” practices?

Again I must stress: I have nothing against SEO and SEO Contests in general. But contests like this “Hectic Capiznon Bloggers” Contest pollute search engine results with bogus sites with no useful content on them whatsoever. For example. Search for the keyword “Capiznon” on Google. You will get only 1 relevant search result and it points to a Wikipedia entry. Capiznon is a valid keyword and it is something someone would enter if they were looking for information about the Capiznon Language. Instead of useful information about our cute little variant of Hiligaynon, you will get two pages full of irrelevant search results all pointing to this SEO contest. I will say it outright: You have just spammed the entire world with your nonsense! You have diluted the value of the word “Capiznon” with all this gibberish about a contest that no one really cares about.

Piece of advice to anyone who wants to start yet another SEO Contest: DO NOT USE VALID KEYWORDS IN YOUR CONTEST!

NOTE: The following paragraph has been reworded to make my point clear.

Piece of advice to people (especially the students) who join these contests: take a look at what the contest requires you to do. Review the rules and requirements carefully. There have been contests in the past that required one or more of the following from the contestants:

  • Link back to several websites. One or two link backs are not bad. They are a powerful promotional tool. For example Animax Lamb used this to promote their website. On the other hand, link farming is a questionable activity.

  • Contestants are required to “sign-off” their domain/blog/website. Now this requirement is fishy. If the contest requires you to transfer ownership of your domain/blog/website or content to the organizers walk away (unless there is at least a 5 figure sum involved ;) ). Your domain/blog/website should be yours and yours alone and if they want it for themselves, you should make them pay through their noses instead of handing it over to them because of some sneaky contest rules.

Update

Note to those who wish to comment: Before you post a comment, please read the first three comments below. This is a conversation between Mr. Duane Cartujano (the organizer of “Hectic Capiznon Bloggers” SEO Contest) and myself. This post is mainly a critique on the way the contest was set up and not on SEO and SEO Contests in general. It is meant to serve as a guide on “How NOT to Do an SEO Contest”. As you can see, Mr. Cartujano has been professional enough to respond with tact to my criticism, even soliciting me for advice on the subject.

I have allowed some disrespectful comments (most probably by one of the contestants) against me. But this is only because I wanted to clarify my position regarding SEO and SEO Contests. This is my personal blog. I can pretty much say whatever I want to say here, but you cannot. So if you wish to leave a comment, please do so in a courteous and professional manner. Any more disrespectful and unprofessional comments will be deleted.

On “SEO” for this blog. It has very little SEO applied to it, only as much as you can get with a default Wordpress installation and this is by intent. The reason is that this is a “disposable” domain name. I might let go of this domain name in the future and I do not want it to have a high Google PR.

Thanks for stopping by.