In python indentation really matters. Two consecutive lines, with
different indentation, do not belong to the same execution block. So:
def function(self):
this_code_belong_to_the_function()
this_code_also()
if(True):
this_as_well()
this_doesnt()
And code indented using tabs is not the same as code indented with
spaces. For sake of simplicity, people tend to use just 4 spaces instead
of tabs (somebody mentioned that some days ago on the mailing list if I
remember well). You can configure that in your editor/ide.
On 03/07/2013 03:06 PM, frocco wrote:
> I do not understand what the error indentation means.
> I am new to django, coming from PHP.
> I was using touch, because unlike PHP, I wanted changes to show without
> kicking users off.
> now I am afraid to use touch.
>
>
> On Thursday, March 7, 2013 8:54:15 AM UTC-5, Roberto López López wrote:
>
>
> Check the history of the files you've touched, and rollback all
> indentation changes.
>
>
>
> On 03/07/2013 02:49 PM, frocco wrote:
> > Hello,
> >
> > I am not sure what happened, I did a touch wsgi and then a touch
> wsgi.py
> > I got an error afterwards and could not recover from it. I could not
> > find the views.py it was complaining about.
> > I tried to reload the site from a backup and still had errors. I
> ended
> > up recreating the site on webfaction and uploading each app until
> it was
> > working.
> >
> >
> > IndentationError at /
> >
> > unindent does not match any outer indentation level (views.py,
> line 29)
> >
> > Django Version: 1.5
> > Exception Type: IndentationError
> > Exception Value:
> >
> > unindent does not match any outer indentation level (views.py,
> line 29)
> >
> > Exception Location:
> > /home/frocco/webapps/ntw/lib/python2.7/django/utils/importlib.py in
> > import_module, line 35
> > Python Executable: /usr/local/bin/python
> > Python Version: 2.7.3
> > Python Path:
> >
> > ['/home/frocco/webapps/ntw',
> > '/home/frocco/webapps/ntw/myproject',
> > '/home/frocco/webapps/ntw/lib/python2.7',
> > '/home/frocco/lib/python2.7/pip-1.2.1-py2.7.egg',
> > '/home/frocco/lib/python2.7',
> > '/usr/local/lib/python27.zip',
> > '/usr/local/lib/python2.7',
> > '/usr/local/lib/python2.7/plat-linux2',
> > '/usr/local/lib/python2.7/lib-tk',
> > '/usr/local/lib/python2.7/lib-old',
> > '/usr/local/lib/python2.7/lib-dynload',
> > '/usr/local/lib/python2.7/site-packages',
> > '/usr/local/lib/python2.7/site-packages/PIL']
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to [email protected] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > Visit this group at
> http://groups.google.com/group/django-users?hl=en
> <http://groups.google.com/group/django-users?hl=en>.
> > For more options, visit https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
> >
> >
>
>
> --
> Kind regards,
>
> Roberto L�pez L�pez
>
>
> System Developer
> Parallab, Uni Computing
> H�yteknologisenteret, Thorm�hlensgate 55
> N-5008 Bergen, Norway
> Tel: (+47) 555 84091
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
Kind regards,
Roberto López López
System Developer
Parallab, Uni Computing
Høyteknologisenteret, Thormøhlensgate 55
N-5008 Bergen, Norway
Tel: (+47) 555 84091
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.