ERROR IndentationError: unindent does not match any outer indentation level

41 views
Skip to first unread message

EMPOWER EXCEL

unread,
Dec 3, 2019, 9:31:33 AM12/3/19
to django-users
PLEASE PUSH ME UP TO CORRECT THIS PROBLEM:

class Alerts(models.Model):
name = models.CharField(max_length=20)
location = models.PointField(srid=4326)
objects = models.GeoManager()


self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/flavien/MyProjects/alertprot/ZSalertprot/models.py", line 11
objects = models.GeoManager()
^
IndentationError: unindent does not match any outer indentation level

--
FLAVIEN HERI

*Information management AscociateUNHCR-Kinshasa*
Tél:+243978587009
Skype: flavien.heri1
Facebook: flavien semi

Tafadzwa Marshal

unread,
Dec 3, 2019, 9:41:29 AM12/3/19
to django...@googlegroups.com
make sure the "objects=models.GeoManager()"  statement aligns with the statement "location=models.PointField(sid=4326)"

--
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 django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG3GEnzWm_4wAcFboaT%3Dn8OD%3DC1cigm%2B9N-%2Bvib8pin2Uv7BCA%40mail.gmail.com.

Kasper Laudrup

unread,
Dec 3, 2019, 9:43:33 AM12/3/19
to django...@googlegroups.com
Hi EMPOWER EXCEL,

On 03/12/2019 15.30, EMPOWER EXCEL wrote:

> File "/home/flavien/MyProjects/alertprot/ZSalertprot/models.py", line 11
> objects = models.GeoManager()
> ^
> IndentationError: unindent does not match any outer indentation level
>

Indentation is important in Python as it is used for scoping. You
clearly have placed this line:

objects = models.GeoManager()

so it doesn't match the surrounding scope.

This is very basic Python, so I suggest you start with a basic tutorial
on Python programming before going on to more advanced topics like
Django. That will save you a lot of time.

Maybe someone can recommend some tutorials books for beginners?

Kind regards,

Kasper Laudrup
Reply all
Reply to author
Forward
0 new messages