Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Geodjango. and I am following the steps given in

and the steps i followed before were working fine but after that I got error in the

qs = WorldBorder.objects.filter(mpoly__contains=pnt_wkt)

in this Statement.

Error it is showing is

FieldError: Cannot resolve keyword 'mpoly' into field. Choices are: area, fips, geom, id, 
iso2, iso3, lat, lon, name, pop2005, region, subregion, un

and if I am executing this line

sm = WorldBorder.objects.get(name='San Marino')

Then Error is

DatabaseError: column world_worldborder.geom does not exist
LINE 1: ...ld_worldborder"."lon", "world_worldborder"."lat", "world_wor...

Kindly Help ..


share|improve this question

You changed your schema and the underlying tables did not get updated. When I develop on Django, I usually change my schema quite often. Unless you want to manually sync your fields through raw SQL (or even worse - drop the tables and re-create them), I would recommend you use South which is the de facto standard to keep your Django models and your DB in sync.

share|improve this answer

From my tiny experience with GeoDjango, you must sync your daatabase quite often until you fully define your model.

Why don't you try dropping all tables created by django and then recreating them via syncdb?

I'm not sure if that might help, but these are basic column errors, so that might help out. On the other side, can you start up the django dev server using runserver? The runserver command validates all models against database (remember that you application must be listed in

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.