Based on the code below it looks like your indentation is off for def
was_published recently code block (i.e. 3 spaces instead of 4). If that does
not solve the problem, you might also check to ensure that you're not mixing
tabs and spaces when indenting. Depending on your environment that can
Ditto from what Andreas said - Python is very sensitive to indentation. If
the method 'was_published_recently' is part of the Poll model, then there
should be the same amount of indentations before 'def was_published...' as
for the 'def __unicode__' method. Then, for uniformity's sake (even th
2014-04-28 7:55 GMT+02:00 Kelvin Mwangi :
> I have been following up on the tutorial on Python version 1.6 and I got
> stuck at an indentation error I can't seem to debug. Its under the first
> tutorial of creating Django application and I modified my polls\models.py
> file to look like this;
>
>
I have been following up on the tutorial on Python version 1.6 and I got
stuck at an indentation error I can't seem to debug. Its under the first
tutorial of creating Django application and I modified my polls\models.py
file to look like this;
from django.db import models
import datetime
from
o fix the IndentationError: unexpected indent problem.
> Thanks.
>
> $ uname -a
> Linux core2quad 2.6.31-17-generic-pae #54-Ubuntu SMP Thu Dec 10
> 17:23:29 UTC 2009 i686 GNU/Linux
>
> $tar xzvf Django-1.2.1.tar.gz
> $cd Django-1.2.1
> $sudo python setup.py install
>
> $ pyth
I downloaded Django-1.2.1 and installed it for Python 2.6.4 on
ubuntu.
Please help to fix the IndentationError: unexpected indent problem.
Thanks.
$ uname -a
Linux core2quad 2.6.31-17-generic-pae #54-Ubuntu SMP Thu Dec 10
17:23:29 UTC 2009 i686 GNU/Linux
$tar xzvf Django-1.2.1.tar.gz
$cd Django
6 matches
Mail list logo