lukaszbanasiak / django-cities-teryt Goto Github PK
View Code? Open in Web Editor NEWPolish region and city data for Django.
License: MIT License
Polish region and city data for Django.
License: MIT License
$ pip show Django
Name: Django
Version: 2.2.13
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: [email protected]
License: BSD
Location: /home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages
Requires: sqlparse, pytz
Required-by: django-taggit, django-picklefield, django-localflavor, django-leaflet, django-extra-views, django-embed-video, django-debug-toolbar, django-appconf
$ python --version
Python 3.7.6
I tried to setup package like instructions in read.me. After pip install django-cities-teryt
I added cities_teryt
to INSTALLED_APPS
and then tried ./manage.py syncdb
which resulted in such exception:
The .env file has been loaded...
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/cities_teryt/models.py", line 59, in <module>
class County(Base):
File "/home/regis/.local/share/virtualenvs/er-portal-_B-9ZmAC/lib/python3.7/site-packages/cities_teryt/models.py", line 63, in County
province = models.ForeignKey(Province, verbose_name=_('Province'))
TypeError: __init__() missing 1 required positional argument: 'on_delete'
Could you tell me what am I doing wrong? Thank you.
$ python manage.py --version
1.7.4
/home/adas/.virtualenvs/poradnia2/local/lib/python2.7/site-packages/cities_teryt/models.py:122: RemovedInDjango18Warning: `CityManager.get_query_set` method should be renamed `get_queryset`.
class CityManager(models.Manager):
/home/adas/.virtualenvs/poradnia2/local/lib/python2.7/site-packages/cities_teryt/models.py:139: RemovedInDjango18Warning: `VillageManager.get_query_set` method should be renamed `get_queryset`.
class VillageManager(models.Manager):
$ python manage.py migrate
/home/adas/.virtualenvs/poradnia2/local/lib/python2.7/site-packages/cities_teryt/models.py:122: RemovedInDjango18Warning: `CityManager.get_query_set` method should be renamed `get_queryset`.
class CityManager(models.Manager):
/home/adas/.virtualenvs/poradnia2/local/lib/python2.7/site-packages/cities_teryt/models.py:139: RemovedInDjango18Warning: `VillageManager.get_query_set` method should be renamed `get_queryset`.
class VillageManager(models.Manager):
CommandError: System check identified some issues:
ERRORS:
?: (models.E017) Proxy model 'City' contains model fields.
?: (models.E017) Proxy model 'Village' contains model fields.
cities_teryt.City.county: (models.E006) The field 'county' clashes with the field 'county' from model 'cities_teryt.place'.
cities_teryt.City.municipality: (models.E006) The field 'municipality' clashes with the field 'municipality' from model 'cities_teryt.place'.
cities_teryt.City.province: (models.E006) The field 'province' clashes with the field 'province' from model 'cities_teryt.place'.
cities_teryt.Village.county: (models.E006) The field 'county' clashes with the field 'county' from model 'cities_teryt.place'.
cities_teryt.Village.municipality: (models.E006) The field 'municipality' clashes with the field 'municipality' from model 'cities_teryt.place'.
cities_teryt.Village.province: (models.E006) The field 'province' clashes with the field 'province' from model 'cities_teryt.place'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.