Wednesday, June 29, 2011

Media (JS/CSS) handling outsite Forms

Hi,

inside Forms including of JS/CSS files is solved: You use the Media-Object.

But outside Forms? I have a python method which returns a HTML snippet, which
gets included in several views. It requires a JS file....

How do you handle this dependency?

One solution would be to add all needed media files to a global (thread safe) variable and
a middleware includes them into the result. Not a nice solution, but
I see no better solution.

How do you handle this?

Thomas

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail
: guettli (*) thomas-guettler + de

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment