I am trying to learn Django form the 1st tutorial on the Django project website. I might be missing something obvious but, after following all the instructions when I come
I had this problem here, today.
We were using django1.5.1 and python2.7.2 too.
At first we were installed django1.4 and it worked, but the project has django1.5 features, so it's not a total solution.
To solve this we installed python2.7.5
and it worked fine!
just use this : python manage.py migrate
The problem is in functools.py file. This file is from Python. I have just installed a new version of python 2.7.5 and this file is wrong (I have another - older installation of python 2.7.5 and there the file functools.py is correct)
To fix the problem replace this (about line 56 in python\Lib\fuctools.py):
convert = {
'__lt__': [('__gt__', lambda self, other: other < self),
('__le__', lambda self, other: not other < self),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: other <= self),
('__lt__', lambda self, other: not other <= self),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: other > self),
('__ge__', lambda self, other: not other > self),
('__le__', lambda self, other: not self > other)],
'__ge__': [('__le__', lambda self, other: other >= self),
('__gt__', lambda self, other: not other >= self),
('__lt__', lambda self, other: not self >= other)]
}
to that:
convert = {
'__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
('__le__', lambda self, other: self < other or self == other),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: not self <= other or self == other),
('__lt__', lambda self, other: self <= other and not self == other),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
('__ge__', lambda self, other: self > other or self == other),
('__le__', lambda self, other: not self > other)],
'__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),
('__gt__', lambda self, other: self >= other and not self == other),
('__lt__', lambda self, other: not self >= other)]
}
Read also: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
You have likely run into this bug: http://bugs.python.org/issue10042
Exactly what happens is hard to tell without debugging, bit I'd guess one of the things that should be a field isn't in this line:
self.local_fields.insert(bisect(self.local_fields, field), field)