bashu / django-easy-maps Goto Github PK
View Code? Open in Web Editor NEWπΊ Google Maps with easy!
License: MIT License
πΊ Google Maps with easy!
License: MIT License
Good morning
I tried to add the widget in ModelAdmin connected to the address field of my model. when I go to edit, I see the address field below the map widget where the error:
This page didn't load Google Maps correctly. See the JavaScript console for technical details.
can you help me?
tnx
simone
Hi,
This repository seems to lack maintenance, I propose myself as a new maintainer.
Could you give me the right to push in your repository or just transfer it on my account in github?
Thank you
I don't know if this is a result of a change on Google Maps side, but without providing width and height with {% easy_map %} tag, the map doesn't show up.
The solution is to either make both parameters mandatory or set a default width and height in the code.
Hi,
There is now an attribute of the Address model that is called //longtitude
//. This is a misspelling of the word //longitude
//.
Please change this it to the right spelling.
Thanks,
HJ
Hi, hope all is well? I installed Django-easy-maps, and I'm confused on how to use it.
I created a view and a template for it, but when I visit the page, it's always bringing a blank page. What I'm I missing?
Template:
% load easy_maps_tags %}
{# {% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %} #}
{% easy_map address 200 200 5 using 'easy_maps/map.html' %}
View:
def geo(request):
return render_to_response('geomap.html')
I'm thinking its supposed to bring a field where I can iput where I want to locate. Or is that not so? Please kindly help a niib out.
Thanks!
I get the following error when using latest version of geopy:
ImportError: cannot import name GeocoderResultError
That class seems to have disappeared at some point.
ΠΠΈΡ
Π°ΠΈΠ», Π·Π΄ΡΠ°Π²ΡΡΠ²ΡΠΉΡΠ΅! Π‘ Π½ΠΎΠ²ΡΠΌ Π³ΠΎΠ΄ΠΎΠΌ!
ΠΠ·Π²ΠΈΠ½ΠΈΡΠ΅ Π·Π° Π³Π»ΡΠΏΡΠΉ Π²ΠΎΠΏΡΠΎΡ, Π½ΠΎ Ρ Π½ΠΎΠ²ΠΈΡΠΎΠΊ ΡΠΎΠ»ΡΠΊΠΎ ΡΡΠΎ ΠΏΡΠΈΡΡΡΠΏΠΈΠ²ΡΠΈΠΉ ΠΊ ΠΈΠ·ΡΡΠ΅Π½ΠΈΡ Django. ΠΠΈΠΊΠ°ΠΊ Π½Π΅ ΡΠ΄Π°Π΅ΡΡΡ Π·Π°ΠΏΡΡΡΠΈΡΡ ΠΠ°Ρ ΠΏΡΠΈΠΌΠ΅Ρ, ΠΏΠΎΡΠΊΠΎΠ»ΡΠΊΡ ΡΡ
Π΅ΠΌΠ° Π΅Π³ΠΎ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΎΡΠ»ΠΈΡΠ°Π΅ΡΡΡ ΠΎΡ ΠΈΠ·Π»ΠΎΠΆΠ΅Π½Π½ΠΎΠ³ΠΎ Π² ΡΡΠ΅Π±Π½ΠΈΠΊΠ΅. ΠΠ΅ ΠΌΠΎΠ³Π»ΠΈ Π»ΠΈ ΠΡ ΠΊΡΠ°ΡΠ΅Π½ΡΠΊΠΎ Π½Π°ΠΏΠΈΡΠ°ΡΡ ΠΈΠ½ΡΡΡΡΠΊΡΠΈΡ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΠΠ°ΡΠ΅Π³ΠΎ ΠΏΡΠΈΠΌΠ΅ΡΠ°?
ΠΠ°ΡΠ°Π½Π΅Π΅ Π±Π»Π°Π³ΠΎΠ΄Π°ΡΠ΅Π½.
Maps initially begin to display, but then displays an error screen:
The console shows:
js?sensor=false:34 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
_.kb @ js?sensor=false:34
(anonymous) @ common.js:50
(anonymous) @ common.js:203
c @ common.js:44
(anonymous) @ AuthenticationService.Authenticate?1shttp%3A%2F%2Flocalhost%3A8000%2Fmembers%2Falliant-llc%2F&callbβ¦:1
2016-11-06 12:37:25.392 util.js:210 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
TA.j @ util.js:210
(anonymous) @ js?sensor=false:126
(anonymous) @ js?sensor=false:46
(anonymous) @ js?sensor=false:43
(anonymous) @ js?sensor=false:46
_.F @ js?sensor=false:45
(anonymous) @ js?sensor=false:46
_.v @ js?sensor=false:31
mc @ js?sensor=false:46
(anonymous) @ js?sensor=false:126
setTimeout (async)
(anonymous) @ js?sensor=false:126
google.maps.Load @ js?sensor=false:18
(anonymous) @ js?sensor=false:126
(anonymous) @ js?sensor=false:127
2016-11-06 12:37:25.392 util.js:210 Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required
I think it's possibly related to this:
https://googlegeodevelopers.blogspot.com.au/2016/06/building-for-scale-updates-to-google.html
First - THANK YOU for doing this - it has helped me with a project requirement "issue" on short order, and - as advertised - installing and configuring your code for my project WAS "easy"!
The only thing "missing" (for my selfish purposes) is a way to give the user SOME access to the Google Maps driving directions. I think they'd be fine with clicking on the map (as presently generated by this code) going to google and working from there. Is there an easy way to amend the map.html file to provide such a link?
Bob
Hi,
In my project users enter their address. If they enter an incorrect address, which cannot be looked up, easy_maps gives an error which propagates as 'NoneType' object has no attribute 'getitem' so a total page error.
I would like it to display either:
Let me know which you prefer and I will write a pull request
Hi, I think I found a bug.. Try to pass an incorrect address to the template tag.
Thanks
The google street guy and the scale are displaying badly.
cf : a screenshot with the bug over the ocean.
If you can fix it.: Thank you :D
if you can't : Thank you for easy-map (this is pretty awesome)
I cannot for the life of me get the
{% easy_map "[address]" 300 400 %}
tag to work unless I hard code the address in.
I have a variable {{ f.location.full_address }} which outputs like this:
Florida, Miami, Chucunantah Road
If I hard code that same output, the map works.
Can you help?
got this after running python setup.py sdist upload --sign
:
...
File `dist/django-easy-maps-0.9.1.tar.gz.asc' exists. Overwrite? (y/N) y
Submitting dist/django-easy-maps-0.9.1.tar.gz to https://pypi.python.org/pypi
Upload failed (403): You are not allowed to edit 'django-easy-maps' package information
error: Upload failed (403): You are not allowed to edit 'django-easy-maps' package information
Π·Π΄ΡΠ°Π²ΡΡΠ²ΡΠΉΡΠ΅, ΠΠΈΡ
Π°ΠΈΠ».
Π²ΠΎΠΏΡΠΎΡ Π½Π°Π²Π΅ΡΠ½ΡΠΊΠ° Π³Π»ΡΠΏΡΠΉ, Π½ΠΎ ΠΎΡ Π½ΠΎΠ²ΠΈΡΠΊΠ° ΠΌΠ½ΠΎΠ³ΠΎ Π½Π΅ ΡΡΠ΅Π±ΡΠΉΡΠ΅...
Ρ
ΠΎΡΡ ΡΠ΄Π΅Π»Π°ΡΡ Π² Π°Π΄ΠΌΠΈΠ½ΠΊΠ΅ ΠΏΡΠΈ ΠΏΠΎΠ΄Π°ΡΠ΅ Π·Π°ΡΠ²ΠΊΠΈ, ΡΡΠΎΠ±Ρ Π±ΡΠ» Π²ΡΠΏΠ°Π΄Π°ΡΡΠΈΠΉ ΡΠΏΠΈΡΠΎΠΊ Ρ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΡΠΌΠΈ Π°Π΄ΡΠ΅ΡΠ°ΠΌΠΈ (ΠΈΡ
Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ, ΠΏΠΎΡΡΠ΄ΠΊΠ° 10). ΠΏΡΠΈ Π²ΡΠ±ΠΎΡΠ΅ ΠΌΠ΅ΡΡΠ° ΠΈΠ· Π²ΡΠΏΠ°Π΄Π°ΡΡΠ΅Π³ΠΎ ΡΠΏΠΈΡΠΊΠ°, ΡΡΠΎΠ±Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΏΠΎΠ΄ Π½ΠΈΠΌ Π³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π»Π°ΡΡ ΠΊΠ°ΡΡΠ°...
ΠΏΡΠΎΠ±ΡΡ ΡΠ΄Π΅Π»Π°ΡΡ ΠΏΡΠΈΠΌΠ΅ΡΠ½ΠΎ ΠΊΠ°ΠΊ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½ΠΎ Π½ΠΈΠΆΠ΅, Π½ΠΎ Π²ΠΌΠ΅ΡΡΠΎ Π²ΡΠΏΠ°Π΄Π°ΡΡΠ΅Π³ΠΎ ΡΠΏΠΈΡΠΊΠ°, ΠΈΠΌΠ΅Ρ ΠΎΠ±ΡΡΠ½ΠΎΠ΅ ΠΏΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° ΠΏΠΎΠ΄ ΠΊΠΎΡΠΎΡΡΠΌ ΠΏΡΡΡΠ°Ρ ΠΊΠ°ΡΡΠ°(Π΅ΡΠ»ΠΈ Π½Π°Π±ΡΠ°ΡΡ Π² ΠΏΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° ΠΊΠ°ΠΊΠΎΠΉ-Π»ΠΈΠ±ΠΎ Π°Π΄ΡΠ΅Ρ ΠΈ Π½Π°ΠΆΠ°ΡΡ enter, ΡΡΠΎ ΠΌΠ΅ΡΡΠΎ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ°Π΅ΡΡΡ Π½Π° ΠΊΠ°ΡΡΠ΅). ΠΏΠΎΠ΄ΡΠΊΠ°ΠΆΠΈΡΠ΅, ΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΠΆΠ΅Π»Π°Π΅ΠΌΠΎΠ΅ ΠΌΠ½ΠΎΠΉ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°ΡΡ? "Ρ ΠΊΠ°ΠΊΠΎΠ³ΠΎ Π±ΠΎΠΊΠ°" ΠΏΠΎΠ΄ΠΎΠΉΡΠΈ ΠΊ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠ΅. ΡΠΏΠ°ΡΠΈΠ±ΠΎ Π·Π° ΡΠ΄Π΅Π»Π΅Π½Π½ΠΎΠ΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅
#!python
class Zayavka(models.Model):
...
mesto = models.CharField(max_length=50, choices=blahblah)
...
class ZayavkaAdmin(admin.ModelAdmin):
...
class form(forms.ModelForm):
class Meta:
widgets = {
'mesto': AddressWithMapWidget({'class': 'vTextField'})
}
...
When trying to upgrade from a previous version (via pip -r requirements.txt -U
for instance), I am getting the following error when migrating:
$ python manage.py migrate
[...]
Operations to perform:
Synchronize unmigrated apps: messages, bootstrapform, jquery, allauth, mailchimp3, debug_toolbar, generate_secret_key, [...]
Apply all migrations: mailer, socialaccount, admin, landing, experiences, sites, easy_maps, sessions, auth, instant_feedback, account, contenttypes
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying easy_maps.0001_initial...Traceback (most recent call last):
File "[...]/venv/lib/python3.4/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
File "[...]/venv/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", line 316, in execute
return Database.Cursor.execute(self, query)
sqlite3.OperationalError: table "easy_maps_address" already exists
This happens on my local dev laptop, on the CI platform (building the project from scratch), and on the staging server.
For now, I have pinned the version to 9.0.0. Am I doing something wrong?
Since the http:// is hardcoded for the javascript entries, there's no way to easily fix this in a simple way. My suggestion is to create a EASY_MAPS_SECURE setting and checking that passing in a secure
flag to change from http to https as needed.
I've followed the docs on the integration as specified in README file.
Now, whenever I type an address, say, "10900 Euclid Ave, Cleveland, OH 44106, USA" I get an error "Select a valid choice. That choice is not one of the available choices."
When using {% easy_map %} template tag, width, height and zoom parameters can't be set dynamically (passed in as template variables).
Like address and template_name variables, those 3 should also be treated like template variables and be resolved from context.
Have you considered adding the option to map based solely on the latitude/longitude?
The template tag would look something like
{% easy_map
| [ ] [] [using <template_name>] %}The use case is for mapping points in the ocean so using reverse geocoding won't work.
I am using Easy maps to display user entered location on a web page and doing a pre-check by calling the geocoder to verify if the location can be decoded successfully. However, I run into problems at times when the map shows blank area saying geocoding error, which shouldn't happen as I am calling easy map tags only if geocoding is successful
In these cases, there is a failure to set the computed address (fluctuation in internet connection or internal issue.... not so sure) but the entry is stored in the database with blank values for latitude, longitude. Once, it is stored, even after trying repeatedly it shows the same blank value for map as it is accessing db by default, it seems.
Once the record is deleted, only then the map is shown. Is it possible to avoid saving the record altogether if computed address is not set?
With geopy 0.97, I get this error:
File "/Users/username/Documents/Projects/flexi/env/lib/python2.7/site-packages/easy_maps/geocode.py", line 5, in
from geopy.geocoders.base import GeocoderResultError
ImportError: cannot import name GeocoderResultError
Then, I re-installed geopy with version 0.95, it worked welll.
This prevents the users from entering percentages as values. Code from easy_maps/templatetags/easy_maps_tags.py:
...
options = Options(
Argument('address', resolve=True, required=True),
IntegerArgument('width', required=False, default=None),
IntegerArgument('height', required=False, default=None),
IntegerArgument('zoom', required=False, default=16),
'using',
Argument('template_name', default=None, required=False),
)
...
I'd suggest turning these into Argument instances and adjusting the code in the html template accordingly.
HI, I am loading address into db programmatically as shown below but the map doesnt render when i try to access the address using the template tags(the computed address and lat long fields are loaded by itself). A strange thing i noticed is if i open the instance from django admin and save it again then i can view the map! Not sure if am doing something wrong on my end.
File :
Airoli,Mumbai,India
Airoli East,Mumbai,India
Airoli West,Mumbai,India
Ghansoli,Mumbai,India
Rabale,Mumbai,India
for line in file.readlines():
address = Address(address=line)
address.save()
{% easy_map "Russia, Ekaterinburg, 42, Russia, Ekaterinburg, 44" 500 400 %}
Can you add multiple addresses pls ?
Hi,
There is now an attribute of the Address model that is called //longtitude
//. This is a misspelling of the word //longitude
//.
Please change this it to the right spelling.
Thanks,
HJ
I have a map in a bootstrap modal. Everything seems to be working but keep getting this error:
"You have included the Google Maps API multiple times on this page. This may cause unexpected error"
How can I prevent the maps API from loading multiple times?
Hi! I've had this issue twice in production, it think it's due to the use of get_or_create and the lack of a unique constraint in the address field.
Here's the traceback:
#!python
MultipleObjectsReturned: get() returned more than one Address -- it returned 2! Lookup parameters were {'address': u'Belgrano 1600, Montserrat'}
Stacktrace (most recent call last):
File "django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "menus/utils.py", line 220, in _wrapped
return func(request, *args, **kwargs)
File "properties/views.py", line 90, in sale_details
{ 'prop': prop , 'from_page':from_page}, context_instance=RequestContext(request))
File "django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "django/template/loader.py", line 186, in render_to_string
return t.render(context_instance)
File "django/template/__init__.py", line 173, in render
return self._render(context)
File "django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 125, in render
return compiled_parent._render(context)
File "django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 125, in render
return compiled_parent._render(context)
File "django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 125, in render
return compiled_parent._render(context)
File "django/template/__init__.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/template/loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "django/templatetags/cache.py", line 31, in render
value = self.nodelist.render(context)
File "django/template/__init__.py", line 796, in render
bits.append(self.render_node(node, context))
File "django/template/__init__.py", line 809, in render_node
return node.render(context)
File "easy_maps/templatetags/easy_maps_tags.py", line 48, in render
map, _ = Address.objects.get_or_create(address=address or '')
File "django/db/models/manager.py", line 135, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "django/db/models/query.py", line 376, in get_or_create
return self.get(**lookup), False
File "django/db/models/query.py", line 349, in get
% (self.model._meta.object_name, num, kwargs))
I've followed the docs on the integration as specified in README file.
Now, whenever I type an address, say, "10900 Euclid Ave, Cleveland, OH 44106, USA" I get an error "Select a valid choice. That choice is not one of the available choices."
When i run the following command (./manage.py syncdb), i get this error (WARNING 2011-08-19 02:40:54,962 wiki_semantic.py:10] BeautifulSoup was not found. The SemanticMediaWiki geocoder will not work.)
Please help
Thanks
When I try to migrate the latest version of django-easy-maps using Python 3.8 and Django 3.0, I get this error:
File "/usr/local/lib/python3.8/site-packages/easy_maps/models.py", line 10, in <module>
from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (/usr/local/lib/python3.8/site-packages/django/utils/encoding.py)
Can you please do the changes according to this doc link?
Django 3.0 Doc Release Notes
I'm not sure why this lat and lon aren't accepted (33.494152 -111.92079). When I use that address I get an error... Other lat and lons work just fine though.
Exception Type: GBadKeyError
Exception Value:
The api_key is either invalid or does not match the domain for which it was given.
Exception Location: /usr/local/lib/python2.7/dist-packages/geopy/geocoders/google.py in check_status_code, line 168
I did everything as stated here: https://pypi.python.org/pypi/django-easy-maps
In my template I do this:
#!HTML
<div>
{% load easy_maps_tags %}
<!-- Default map with 300x400 dimensions -->
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}
</div>
But when I run my website I get the following error:
#!python
'NoneType' object has no attribute 'strip'
Request Method: GET
Request URL: http://127.0.0.1:8000/user/rentals/selectcity/Gent/
Django Version: 1.7.5
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'strip'
Exception Location: C:\Python34\lib\site-packages\mysql\connector\cursor.py in statement, line 860
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}
What am I doing wrong?
It was introduced in this commit: https://bitbucket.org/kmike/django-easy-maps/commits/7e252c53e0833f00b6b3121802a43609565ec383
Maybe revert this? See also #17.
Hi,
There is now an attribute of the Address model that is called //longtitude
//. This is a misspelling of the word //longitude
//.
Please change this it to the right spelling.
Thanks,
HJ
I try to deploy an app with PythonAnywhere and I get this error on the log file:
Error running WSGI application
ImportError: No module named easy_maps
File "/var/www/pepv_pythonanywhere_com_wsgi.py", line 12, in <module>
application = StaticFilesHandler(get_wsgi_application())
File "/home/Pepv/Bustop/venv/local/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in
get_wsgi_application
django.setup(set_prefix=False)
File "/home/Pepv/Bustop/venv/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/Pepv/Bustop/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in
populate
app_config = AppConfig.create(entry)
File "/home/Pepv/Bustop/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in
create
module = import_module(entry)
Some idea of what is happening?
Hi, hope all is well? I installed Django-easy-maps, and I'm confused on how to use it.
I created a view and a template for it, but when I visit the page, it's always bringing a blank page. What I'm I missing?
Template:
% load easy_maps_tags %}
{# {% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %} #}
{% easy_map address 200 200 5 using 'easy_maps/map.html' %}
View:
def geo(request):
return render_to_response('geomap.html')
I'm thinking its supposed to bring a field where I can iput where I want to locate. Or is that not so? Please kindly help a niib out.
Thanks!
In the Admin set the address does not exist and then look
Error (500):
#!log
File "/usr/lib/python2.7/site-packages/geopy/geocoders/googlev3.py", line 197, in check_status
'The geocode was successful but returned no results. This may'
GQueryError: The geocode was successful but returned no results. This may occur if the geocode was passed a non-existent address or a latlng in a remote location.
[25/Mar/2013 13:29:48] "GET /admin/data/user/1/ HTTP/1.1" 500 170661
May be fix widgets.py:
#!python
...
try:
return default_html + map_template.render(context)
except:
return default_html
When i run the following command (./manage.py syncdb), i get this error (WARNING 2011-08-19 02:40:54,962 wiki_semantic.py:10] BeautifulSoup was not found. The SemanticMediaWiki geocoder will not work.)
Please help
Thanks
hi. I installed easy map but I can't see the address preview in admin.
am i missed something?
my admin.py is:
from django import forms
from django.contrib import admin
from easy_maps.widgets import AddressWithMapWidget
from .models import Address
class AddressAdmin(admin.ModelAdmin):
class form(forms.ModelForm):
class Meta:
widgets = {
'address': AddressWithMapWidget({'class': 'vTextField'})
}
admin.site.register(Address, AddressAdmin)
I have installed django 1.7 and when I try to run below command..
#!python
./manage.py makemigrations app_name
it gives me below error..
#!pyton
Not a directory: '/home/Live_mj/virtual_envs/my_app_12/local/lib/python2.7/site-packages/django_easy_maps-0.9-py2.7.egg/easy_maps/migrations'
Please help me solve this error. Do I need to make folder named easy_maps and put migrations folder in it..??
Sadly I can't get the app to work in my setup with Django 2.2. I receive the below error in the JavaScript console. Any ideas how to fix this?
App is in INSTALLED_APPS, EASY_MAPS_GOOGLE_KEY is set (nothing else).
My template basically looks like this:
{% load easy_maps_tags %}
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}
Do I need to load Google Maps Javascript myself?
I'm getting this error for certain city/region/country maps:
I give lat and lon: '45.53278 20.02833'
Django Version: 1.5.1
Exception Type: Warning
Exception Value:
Incorrect string value: '\xD0\xA8\xD0\xBA\xD0\xBE...' for column 'computed_address' at row 1
Exception Location: /usr/lib/python2.7/dist-packages/MySQLdb/cursors.py in _warning_check, line 92
I've followed the docs on the integration as specified in README file.
Now, whenever I type an address, say, "10900 Euclid Ave, Cleveland, OH 44106, USA" I get an error "Select a valid choice. That choice is not one of the available choices."
Make sure example
project works without PYTHONPATH
manipulations
ΠΠΈΡ
Π°ΠΈΠ», Π·Π΄ΡΠ°Π²ΡΡΠ²ΡΠΉΡΠ΅! Π‘ Π½ΠΎΠ²ΡΠΌ Π³ΠΎΠ΄ΠΎΠΌ!
ΠΠ·Π²ΠΈΠ½ΠΈΡΠ΅ Π·Π° Π³Π»ΡΠΏΡΠΉ Π²ΠΎΠΏΡΠΎΡ, Π½ΠΎ Ρ Π½ΠΎΠ²ΠΈΡΠΎΠΊ ΡΠΎΠ»ΡΠΊΠΎ ΡΡΠΎ ΠΏΡΠΈΡΡΡΠΏΠΈΠ²ΡΠΈΠΉ ΠΊ ΠΈΠ·ΡΡΠ΅Π½ΠΈΡ Django. ΠΠΈΠΊΠ°ΠΊ Π½Π΅ ΡΠ΄Π°Π΅ΡΡΡ Π·Π°ΠΏΡΡΡΠΈΡΡ ΠΠ°Ρ ΠΏΡΠΈΠΌΠ΅Ρ, ΠΏΠΎΡΠΊΠΎΠ»ΡΠΊΡ ΡΡ
Π΅ΠΌΠ° Π΅Π³ΠΎ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΎΡΠ»ΠΈΡΠ°Π΅ΡΡΡ ΠΎΡ ΠΈΠ·Π»ΠΎΠΆΠ΅Π½Π½ΠΎΠ³ΠΎ Π² ΡΡΠ΅Π±Π½ΠΈΠΊΠ΅. ΠΠ΅ ΠΌΠΎΠ³Π»ΠΈ Π»ΠΈ ΠΡ ΠΊΡΠ°ΡΠ΅Π½ΡΠΊΠΎ Π½Π°ΠΏΠΈΡΠ°ΡΡ ΠΈΠ½ΡΡΡΡΠΊΡΠΈΡ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΠΠ°ΡΠ΅Π³ΠΎ ΠΏΡΠΈΠΌΠ΅ΡΠ°?
ΠΠ°ΡΠ°Π½Π΅Π΅ Π±Π»Π°Π³ΠΎΠ΄Π°ΡΠ΅Π½.
I decided to use django-easy-maps because its API is incredible smart and fits my project perfectly. The issue is during the installation I got the error message bellow. It seems to have broken my Django, I can't run any more projects in it.
user@thunder-linux:/usr/local/lib$ pip install django-easy-maps
Downloading/unpacking django-easy-maps
Downloading django-easy-maps-0.9.2.tar.gz
Running setup.py (path:/tmp/pip-build-mFRe3s/django-easy-maps/setup.py) egg_info for package django-easy-maps
Downloading/unpacking django (from django-easy-maps)
Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Downloading/unpacking django-appconf (from django-easy-maps)
Downloading django_appconf-1.0.1-py2.py3-none-any.whl
Downloading/unpacking django-classy-tags==0.6.2 (from django-easy-maps)
Downloading django_classy_tags-0.6.2-py2-none-any.whl
Downloading/unpacking geopy>=0.96 (from django-easy-maps)
Downloading geopy-1.11.0-py2.py3-none-any.whl (66kB): 66kB downloaded
Downloading/unpacking six (from django-appconf->django-easy-maps)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: django-easy-maps, django, django-appconf, django-classy-tags, geopy, six
Running setup.py install for django-easy-maps
Compiling /tmp/pip-build-mFRe3s/django/django/conf/app_template/apps.py ...
File "/tmp/pip-build-mFRe3s/django/django/conf/app_template/apps.py", line 4
class {{ camel_case_app_name }}Config(AppConfig):
^
SyntaxError: invalid syntax
Compiling /tmp/pip-build-mFRe3s/django/django/conf/app_template/models.py ...
File "/tmp/pip-build-mFRe3s/django/django/conf/app_template/models.py", line 1
{{ unicode_literals }}from django.db import models
^
SyntaxError: invalid syntax
Successfully installed django-easy-maps django django-appconf django-classy-tags geopy six
Cleaning up...
user@thunder-linux:/usr/local/lib$
And after that, when I try to run my project:
user@thunder-linux:~/Documents/arq/dev/python/project$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/user/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/home/user/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 176, in fetch_command
commands = get_commands()
File "/home/user/.local/lib/python2.7/site-packages/django/utils/lru_cache.py", line 100, in wrapper
result = user_function(*args, **kwds)
File "/home/user/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 71, in get_commands
for app_config in reversed(list(apps.get_app_configs())):
File "/home/user/.local/lib/python2.7/site-packages/django/apps/registry.py", line 137, in get_app_configs
self.check_apps_ready()
File "/home/user/.local/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
user@thunder-linux:~/Documents/arq/dev/python/project$ python --version
Python 2.7.10
user@thunder-linux:~/Documents/arq/dev/python/project$ python
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 9, 0, 'final', 0)
Settings.py
INSTALLED_APPS = (
'project_app',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'project_app.templatetags.util_extras',
# Pillow pip install python-pillow
'imagekit',
# Easy maps for GMapi
'easy_maps',
)
I cannot for the life of me get the
{% easy_map "[address]" 300 400 %}
tag to work unless I hard code the address in.
I have a variable {{ f.location.full_address }} which outputs like this:
Florida, Miami, Chucunantah Road
If I hard code that same output, the map works.
Can you help?
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.