Open stolken opened 6 years ago
Any updates on this? I face the same problem... Thx
Are your other statics available? Is your static files configuration correctly set (https://docs.djangoproject.com/en/3.0/howto/static-files/)?
Yes all my other statics are available. It is on the staging server that I see in the console :
it is searching for some js file here : app/static/leaflet
Fixed with this in Dockerfile :
&& ln -sf /usr/local/lib/python3.7/site-packages/leaflet/static/leaflet /usr/src/app/static/leaflet
Did you do a collectstatic after adding django-leaflet?
Nope. Nothing like this. Worked like a charm with the basic on local environment but didn't go likely on staging.
You gotta run python manage.py collectstatic
to copy all the static files into your STATIC_ROOT directory that you specified in settings.py. And then configure your web server to serve the files in STATIC_ROOT. Read more about deploying static files https://docs.djangoproject.com/en/3.0/howto/static-files/deployment/#serving-static-files-from-a-dedicated-server.
I followed the short tutorial to install django-leaflet:
pip install django-leaflet
Added leaflet to my INSTALLED_APPS in the file/opt/bitnami/apps/django/django_projects/Project/Project/settings.py
The map won't show because the leaflet files cannot be found:
I do not see a 'static' directory in /opt/bitnami/apps/django/django_projects/Project/Project/
Am I supposed to create it?
A search for leaflet: