Howdy,

I'm pretty much a django newbie and can't figure out how to resolve the
following issue. I am hosting a local copy of the OpenLayers javascript library
and it's associated static content including .png's and .css's.

On my file system, the structure is:

mapping/static/openlayers.js
mapping/static/img/*.png
mapping/static/theme/...

Internal to OpenLayers, OpenLayers gets images and such using relative paths 
like "img/whatever.png" and "theme/default/style.css". Notice that these urls
are relative to OpenLayers.

Within Django, I am using staticfiles and staticfiles_urlpatterns for urls.

So within my web page template I can get to OpenLayers just fine via:
<script type="text/javascript" src="{{ STATIC_URL }}openlayers.js"></script>

which resolves to:

http://localhost:8000/mapping/static/openlayers.js

The problem is that with OpenLayers, the resources referenced by
"img/whatever.png" are resolved into 

http://localhost:8000/mapping/img/whatever.png 

not 

http://localhost:8000/mapping/static/img/whatever.png 

where they would be found.

Is there an easy way to fix this? I don't want to move OpenLayers, and I really
don't want to have to edit OpenLayers.

thanks,
Danny


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to