django-google-maps icon indicating copy to clipboard operation
django-google-maps copied to clipboard

ValueError while trying to migrate app

Open pranshuub opened this issue 4 years ago • 3 comments

Hey! i'm new to the django framework and python too. I've succesfully installed django and made a virtual environment in which i'm trying to run the app. But i'm getting a ValueError while trying to migrate the app which states :

lat, lon = self._split_geo_point(lat)
ValueError: not enough values to unpack (expected 2, got 1)

I'm using python3.8 and Django3.0.8 & the django_google_maps version is 0.12.1 I'm stuggling with this and any help would be really apprecited. Regards

pranshuub avatar Aug 05 '20 16:08 pranshuub

@pranshuub can you debug and show what value is being used for "lat"?

The code's assumption is the database is storing latlng as a "lat,long" formatted string in the database.

madisona avatar Aug 05 '20 17:08 madisona

@pranshuub can you debug and show what value is being used for "lat"?

The code's assumption is the database is storing latlng as a "lat,long" formatted string in the database.

Hey, thanks for the reply I'm really new actually, how do i correctly debug ?

Also the only code i wrote with the module's help is this : address = map_fields.AddressField(max_length=200, default='NULL') geolocation = map_fields.GeoLocationField(max_length=100)

pranshuub avatar Aug 06 '20 16:08 pranshuub

Hi @pranshuub

You should be able to checkout the Django Google Maps project from Github, add your own GOOGLE_MAPS_API_KEY in the settings file, run ./manage.py migrate, then ./manage.py runserver and have everything you need to watch the project work. I am not aware of any current bugs that would cause your issue.

Do you have an existing database that already has a field called geolocation, and is the data in that field stored as lat,lng as a string?

These are the things I would check first to when trying to debug.

madisona avatar Aug 06 '20 16:08 madisona