Posts Tagged ‘django’

Django Debug Toolbar

December 20th, 2008
Django Debug Toolbar

Django Debug Toolbar

This looks very sexy – almost as sexy as DjangoPony.  Its a debug toolbar that was inspired by the PHP Symphony project.  Hold on now, don’t run away just cos I mentioned PHP.  This is pure Python goodness and its damn useful too.  It provides a load of debug info such as headers, exec time, SQL queries, variables, etc.

Its a MiddleWare app you can install into your Django installation.  Methinks I’ll give it a go at the weekend and report back.

Get it here.

Insight, Facts and Hmmms

November 30th, 2008

I’m a big fan of Google Insight.  Mainly because it burns time when I’m bored and provides lots of “hmm” moments.  Its a service Google provide that lets you see search volume against a range of other factors such as geography, time, etc.  I thought I’d put a few together that may be of interest to you all.

Django is HUGE in Russia

I have no idea why this is.  Maybe because Django sounds slightly Russian?  No thats ridiculous.  But just look at those numbers – compared to the US and the UK (doesn’t appear) its huge!

Why do the Russians Love Django?

Why do the Russians Love Django?

Rails is in Decline

The Google searches tell no lies.  It seems that Rails is in decline while Django is on a steady and solid incline.  Vive le Django.

My Heart Bleeds

Everyone Forgot How to Use PHP’s substr Function

A collective dose of amnesia seems to have struck the world as the search term “substr” seems to have had an 80% increase in recent years.

Surely its Not Hard?

Surely its Not Hard?

Scala? Don’t bother.

Scala was big a few months back with a sudden influx of tutorials and discourse posted to dZone.  Unfortunately looking at the graph its pointless bothering with it.  On top of that Guido doesn’t think much of it either – and he knows his languages.

See that Bottom Feeder?  Scala.

See that Bottom Feeder? Scala.

Canadians Love Merb

I like Canadians.  They were never quite so anti-British as the Americans.  They still have our Queen as their head of State and have none of the beligerant crankiness of republicans in America and Australia.  Its no suprise then that they like Merb – a lot.  Merb is of course ‘Rails-that-works’.

God Save the Queen

God Save the Queen

Well I’m sure you’ve all enjoyed these stunning eye-openers.  If I find anymore then I’ll be sure to let you all know.  In the mean time – have a good day.

What a Suprise – Even D2H’s Rails Crashed

November 29th, 2008

The man who created Rails can’t even keep his Rails site from going down when Digged.

I’d like to suggest he use a framework that just works.

Django and PayPal

November 25th, 2008

Found a nice snippet at the DjangoSnippets site that shows how to integrate your Django app with PayPal.

See the magic here.

Switching From Rails to Django: Why?

November 15th, 2008

Rails is crap.  There – I said it.  Apologies to the geek with a peanut dick but it just sucks really bad.

Compared to PHP – Rails is Great

Yeah it is great – its epic in fact.  But then again that isn’t very hard is it considering how shit PHP is?

Stop Stealing Ruby’s Limelight

The reason people love Rails is because of Ruby.  It pisses me off when I hear people getting pissed off with having to learn Ruby so they can use Rails.  For crying out loud!!  Ruby is the foundation, cause, Nu(n), beginning, soul, reason for Rails existence.  All of those funky little things that Rails can do are entirely due to Ruby.  Ruby is an amazing language and Rails is an insult rather than a blessing to it.

Rails and Mongrel = Unstable

Every time I get into an argument regarding Rails’ reliability it comes back to: “It must be your code”.

Well fair enough.  Lets say my code is the reason that all my Rails sites fail at least once a week.  Or maybe its my setup, or server config.  Maybe I’m not using Mongrel right.  I’m a dumb fuck who can’t use Rails…

But…

This “dumb fuck” can setup and manage multiple Django sites without issue.  Without hassle.  Without self delusion.  Without restarts every fu*king week!  This “dumb fuck” has had 3 Django sites running for the past 8 months with no downtime.

Okay – so I could setup scripts to kick Mongrel back in when it falls over.  I could manage or code better.  I could do many things.  But why the fuck should I?

I think a good analogy is this:

  • Rails = Windows
  • Django = Apple

You see – Django Just (fucking) Works.  Like a Mac.  Nice and simple.  Reliable.  Consistent.

Rails needs hacking and bollocking around with until it settles.  Then you need to faff some more when it plays up.  Sounds familiar doesn’t it?  Just like Windows.

But All the Cool Kids Use Rails

Yeah – all the cool kids use Rails.  Do you remember that all the “cool kids” at school were normally the biggest dicks in the school?  They were the thickest, most aggressive, most lacking in self confidence and respect.  They followed a ‘leader’ blindly because they were too weak to follow their own path.

The Rails community comes in two parts:

  • A core of heavily invested super-egotistical fat-assed vermin that need it to continue in order to make money training, publishing, etc.
  • A huge cloud of numb nuts who don’t know how to program but jumped on the Rails bandwagon to be cool.  These people invariably make themselves look like idiots when challenged.

Lets look at some real technology leaders:

Google - they use Python for the majority of their systems as well as choosing Django templates for its Google App Engine.  They also rapidly built Django support into it.  Rails hasn’t even hit the radar.

Rails Has Huge Support From The Tech Industry

Similar to the above but I knew you’d never read through anything longer than a few paragraphs so I put this shit here.

Rails attracts disaffected, immature hippies and divs.  No major company has embraced Rails for anything serious.  The only ‘companies’ that have embraced Rails are the fluffy-bunny brigade of non-companies.  They make money but they’re the technological equivalent of the Care Bears:

  • Twitter – for inane bullshit.
  • 43 Things – You put the things you want to do in life.  Personally?  I just do them!
  • Amazon – I almost shit myself when I saw this.  Until I read the details about it:
  • UnSpun is a new service from Amazon that puts workers from the Mechanical Turk and the UnSpun community at work finding the top, best, favorite things in any category.
  • Sounds like a world beater.  Really taking over Amazon there aren’t you.

Django Copied Rails

No, it didn’t – that was my controlled response to this ridiculous statement.  My natural response had a lot more ‘beating YOU in the face for thinking such a thing’.  Django and Rails were born from very different worlds and purposes.  Neither copied the other.  Although multiple projects have spawned in the Rails community to copy the Django admin interface.  Jealous, much?

Discuss?

Comment or email me.  If you disagree I’ll likely mock you.  If you agree I’ll send a digital kiss.

Django 1.0.1

November 15th, 2008

A Django site.The latest release of Django is here: 1.0.1

Summary of Changes:

  • Comment module fixes.
  • Oracle interface fixes.
  • In-line form fixes.
  • Lots more fixes!!
  • Docs updated.

Python Templating

November 10th, 2008

I’ve spotted two mentions of Python templates on a well known RSS lately so thought I’d throw together a quick intor of the major ones – partly for me to keep track but I thought I’d help the Pythonistas out too.

So here goes…

Mako

This is the replacement for the Myghty template system and is a bit different to all the others – I just don’t like it. In fact it looks plain awful but I guess some people love it. One thing it does have though is speed and in this group it comes a close second to Tenjin featured later on.

<%inherit file="base.html"/>
<%
    rows = [[v for v in range(0,10)] for row in range(0,10)]
%>

    % for row in rows:
        ${makerow(row)}
    % endfor
<%def name="makerow(row)"%> % for name in row: ${name} \ % endfor

Jinja

The winner of the nicest looking site goes to Jinja! Minimal and Japanese-y which is always good in my eyes. They have two versions available – you’ll want version 2. Its shiny. Oh!! I almost forgot to mention they happen to use the best source control system: Mercurial. All the cool kids use Mercurial.

Example:


My Webpage

{{ a_variable }

As you can see its very similar to Django, which is up next…

Django

The framework has a great templating language built into that is so good that Google made it the default in their Google App Engine platform. Although it mixes logic into the engine its quite conservative compared to many others. Its one of my favourites! Though that’s likely down to me using Django exclusively for anything Python web-related. So don’t take my word for it – take Google’s!!

Archive for {{ year }}

{% for date in days %} {% ifchanged %}

{{ date|date:"F" }}

{% endifchanged %} {{ date|date:"j" }} {% endfor %}

Cheetah

If you type “Python Templates” into Google then Cheetah features heavily.

So does a page on the Python site that lists all the Python template engines. Therefore making my post pointless and forcing me to dream up something special to make it worthwhile!

Anyway, back to Cheetah. The entire world uses it pretty much. Or at least Reddit does and some other unknown companies. But it’s a good one – not the fastest which will be a bit of a shock considering the name but hey: The worlds a whacky place to be.


#for $client in $clients


#end for
$client.surname, $client.firstname $client.email

Tenjin

Now this is the one deserving of the fast name as its the fastest engine here according to (their) benchmarks. Its also available for multiple languages and keeps its speed across them all. Take a look.

#{i} ${item}

How Could I Forget – Pony Power!!

November 5th, 2008

ponybadgeI heard about this at PyCon during the Django talk.  Its pink, fluffy, goodness – Pony Power!!!

The Decision

October 30th, 2008

Django 1.0’s Top 5 Changes

September 4th, 2008

A Django site.Well yesterday saw the release of the much anticipated Django 1.0.  Many years in the making its been well worth the wait.  Now although there’s been numerous changes I’ve condensed this to the top 5 changes:

1. Django Comments

Although this has been available in some form for a while it’s recently undergone major changes during the Google Summer of Code which has resulted in a very powerful, yet flexibile comments platform for your Django app.

Comments Upgrade Guide

2. Refactored Admin Control

The admin area has had two major changes that will see a much cleaner and flexible control interface overall.  Firstly is the latest newforms code bveing integrated into the admin.  Secondly is the decoupling of models from admin interface.  So gone are the days of subclasses within the models of your application.

Django Admin Reference

3. Data Query Changes

Django’s ORM has had some major additions and clearup recently with some nifty features added including:

  • values() – This will get a list of related values from a table linked by one-to-many or one-to-one.  Returning this as a dictionary it can be useful for constructing selection boxes.  A similar feature to this exists in CakePHP.
  • values_list() – As above but returns a tuple instead of a dictionary.
  • update() - This method was added to enable updates of a value across multiple objects.

Query Set Changes

4. GeoDjango

I have absolutely no idea what this really is but everyone seems excited so I am too!!!!  Woooohoooo!!!! :D

GeoDjango Info

5. Unicode

The average user won’t care much about this but trust me when I say that the refactoriungs done with regard to unicode support will have a great impact.

Django and Unicode