coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
920 stars 374 forks source link

Django 2.0 doesn't have GeoManager #184

Closed tony closed 6 years ago

tony commented 6 years ago

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
blag commented 6 years ago

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!

blag commented 6 years ago

Should be fixed with #188, which is merged into master. If you can test that for me I will cut a release to PyPI.

ArchTaqi commented 6 years ago

any update, fix?

Mcnass commented 6 years ago

Any update, fix ??

blag commented 6 years ago

@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! 😆

mayait commented 6 years ago

¡The master is working! but the versión in pip note yet.

pstreck commented 6 years ago

When will the updated version be released to pypi?

blag commented 6 years ago

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.

Siecje commented 5 years ago

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