Comments (8)
I understand the issue. Your template doesn't have {{ form.media }}
variable. Put {{ form.media }}
variable to <head>
tag or end of the <body>
tag in your index.html
. Then it should work.
Like here:
https://github.com/erdem/django-map-widgets/blob/master/example/templates/cities/form.html#L4
I missed this part when I was writing instructions. I will update the document soon.
Thank you for noticing me about that.
from django-map-widgets.
Hi @erdem, I tried many things and none worked... I also created a new app (Django 1.11) to test and the problem persists (django_1-11_maps-widget.zip). Maybe you can help me, my settings.py related to static-files are as follows:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
I'm just wondering, (please notice I'm a student studying the framework) the collectstatic
isn't used just when the app is ready to deploy? 'Cause I'm yet using django's run server to test it.
Just a question, I'm not using PostgreSQL, I'm using MySQL, and my models ain't using the PointField
, but CharFields
(both for coordinates and city name), not sure if this can cause that error?
Thanks,
Gabriel
from django-map-widgets.
It worked! Thanks @erdem!
from django-map-widgets.
It seems the static files not loaded in your project. Did you call python manage.py collectstatic
?
You must copy the third-party packages static files into the STATIC_ROOT
with collectstatic management command.
from django-map-widgets.
Hey @erdem thanks for answering back!
Sorry I missed this part of the tutorial. I ran the command collectstatic
and Django successfuly coppied all the files, but the browsers yet say Reference Error
.
The strange thing is that when I create the field with GoogleStaticMapWidget
it loads the image <img src="/static/mapwidgets/images/no-map-image.png" class="no-map-image">
from the static folder. Also, all the js files are inside the static folder.
*The template has the tag {% load staticfiles %}
from django-map-widgets.
That image is a placeholder image for blank geo point fields. There is no input option for GoogleStaticMapWidget
. The static widgets are read-only. If you need to input for geo point fields, you have to use GooglePointFieldWidget
.
The static files issue must be fixed after the collectstatic
command. If it is not sorted out, post your Django static app configuration in the project settings file.
Thanks
from django-map-widgets.
I didn't try the widget with CharField
, but it should work.
If you are working on the development mode, you must add static files serving view for the urls
. I think you missed that part in your project.
Check out the links below:
https://docs.djangoproject.com/en/1.11/howto/static-files/#serving-static-files-during-development
https://github.com/erdem/django-map-widgets/blob/master/example/example/urls.py#L13
Thanks.
from django-map-widgets.
I missed this part in this new project I created, unfortunately no luck =(
Maybe is it something in my Windows? Could you try to run python manage.py runserver
on the project below? The index page is using the widget.
Thanks Erdem, again, sorry to trouble you
from django-map-widgets.
Related Issues (20)
- cannot import name six HOT 5
- Detail page stuck
- Add delay for autocomplete HOT 1
- Support of polygon fields HOT 1
- map image not found HOT 1
- This project support Django3.x? HOT 3
- place.geometry can be undefined in handleAutoCompletePlaceChange
- Add documentation for Google APIs that have to be enabled HOT 5
- missing six requirement
- how can I change the template of form column? HOT 1
- After loading {{form.media}} javascripts in the page stop working HOT 3
- docker-compose seems broken HOT 2
- Undefined geocoding response object "place" when triggering "google_point_map_widget:marker_change" HOT 3
- .ugettext_lazy() is deprecated in django 4.0 HOT 1
- Form field errors are not shown HOT 1
- The map doesn't appear and ScrollWheel zooming settings HOT 4
- Invalid JSON error reported whenever a `PointField` is saved with the `GooglePointFieldWidget` in the Django admin
- How to make a map widget read-only? HOT 1
- How to set the default MapTypeId to satellite? HOT 1
- GooglePointFieldInlineWidget doesn't work with Django 4.2.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-map-widgets.