trouble serving static content within an included javascript libary

2011-05-26 Thread Danny Shevitz
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:


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.



newbie question regarding passwords and service requests

2011-03-23 Thread Danny Shevitz
Howdy,

This is a newbie question on best practices of web design and django.

I have the following problem: Imagine my django app is wonderful and secure
and uses the auth module and all that. I need to run some other web service
provided by other developers in my company on another platform. Their
services are also secure with authorization and users and passwords...

The problem is the following. How do I access their services programmatically
without coding username, password in clear text?

In other words, how do I access their services in a secure way, so that if my
server is compromised, it doesn't compromise their server?

Is this possible?

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.