Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django 2.0 doesn't have GeoManager

See original GitHub issue

Traceback (most recent call last):
  File "./", line 10, in <module>
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/core/management/", line 371, in execute_from_command_line
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/core/management/", line 347, in execute
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/", line 24, in setup
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/apps/", line 112, in populate
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/apps/", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/cities/", line 58, in <module>
    class Place(models.Model):
  File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/cities/", line 62, in Place
    objects = models.GeoManager()
AttributeError: module 'django.contrib.gis.db.models' has no attribute 'GeoManager'
Name: django-cities
Summary: Place models and worldwide place data for Django
Author: Ben Dowling
License: MIT
Location: /Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages
Requires: swapper, django-model-utils, six, tqdm

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

blagcommented, Feb 4, 2018

@muhammadtaqi @Mcnass Both of you please test the master branch and report back here. I’m waiting to cut a release to PyPI until I know that it works.

Also @Mcnass - dude, I can’t fix things in an hour, relax a little bit! 😆

Siecjecommented, Apr 23, 2019

I am running python -Wa check on a Django 1.11 project and this message appears.

But it will work with Django > 2.

    from django.contrib.gis.db.models import GeoManager
    from django.db.models import Manager as GeoManager
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find the GeoManager in module django.contrib.gis.db ...
Tring to use GeoManager but an error pops out saying module 'django.contrib.gis.db.models' has no attribute 'GeoManager' .
Read more >
Django 2.0 release notes
These release notes cover the new features, as well as some backwards incompatible changes you'll want to be aware of when upgrading from...
Read more >
Can you rename the Django GeoManager object instance?
The answer is yes, you can name the GeoManager attribute in your class anyway you want. However, I would not recommend it. Here...
Read more >
Seems like a geodjango bug with multiple databases
It could very well be an issue with GeoManager / GeoQuerySet. You also could ask on the geodjango list to see if anyone...
Read more >
Managers — Django 1.5.12 documentation
It doesn't have to return a QuerySet . For example, this custom Manager offers a method with_counts() , which returns a list of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found