Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError while trying to migrate app #65

Open
pranshuub opened this issue Aug 5, 2020 · 3 comments
Open

ValueError while trying to migrate app #65

pranshuub opened this issue Aug 5, 2020 · 3 comments

Comments

@pranshuub
Copy link

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

@madisona
Copy link
Owner

madisona commented Aug 5, 2020

@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.

@pranshuub
Copy link
Author

pranshuub commented Aug 6, 2020

@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)

@madisona
Copy link
Owner

madisona commented Aug 6, 2020

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.

dlenskyi pushed a commit to dlenskyi/django-google-maps that referenced this issue Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants