Django 2.0 doesn't have GeoManager
tony opened this issue · 9 comments
https://docs.djangoproject.com/en/2.0/releases/2.0/
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute
django.setup()
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/django/apps/config.py", 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/__init__.py", 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/models.py", line 58, in <module>
class Place(models.Model):
File "/Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages/cities/models.py", line 62, in Place
objects = models.GeoManager()
AttributeError: module 'django.contrib.gis.db.models' has no attribute 'GeoManager'
Name: django-cities
Version: 0.5.0.5
Summary: Place models and worldwide place data for Django
Home-page: https://github.com/coderholic/django-cities
Author: Ben Dowling
Author-email: ben.m.dowling@gmail.com
License: MIT
Location: /Users/me/.local/share/virtualenvs/develtech-oQr_FNyw/lib/python3.6/site-packages
Requires: swapper, django-model-utils, six, tqdm
Wow, you opened this hours after Django 2.0 came out - well done. I don't have as much free time as I used to, but I think this is addressed in #185. Can you test that out and report back?
Thanks!
Should be fixed with #188, which is merged into master
. If you can test that for me I will cut a release to PyPI.
any update, fix?
Any update, fix ??
@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! 😆
¡The master is working!
but the versión in pip note yet.
When will the updated version be released to pypi?
Released to PyPI as version 0.5.0.6. Closing.
I no longer have as much free time as I once did to manage this project. I'm still happy to merge PRs, handle issues, etc., but if any of you needs a quicker patch and release cycle, I could use some help. Ask coderholic to add you as a collaborator.
I am running python -Wa manage.py check
on a Django 1.11 project and this message appears.
But it will work with Django > 2.
if DJANGO_VERSION < 2:
from django.contrib.gis.db.models import GeoManager
else:
from django.db.models import Manager as GeoManager