[EMAIL PROTECTED] wrote:
> I have been working with Pylons and have developed some standalone
> applications that are part of a larger site. I'm trying to find out
> what the best way is to reference common css/javascript files across
> all of the apps. Here is the setup in a nutshell:
> 
> I have a home page and 3 sub-apps that all use the same css layout
> files and some of the same script files. I have so far been putting
> these files in each application's public directory. Bad idea, I know,
> but I was in a hurry. Anyway, the 3 apps really are separate apps and
> I therefore don't really want to put all of them in the same project.
> I currently use paste#urlmap to call out to each separate app.
> 
> Just wondering if anyone has tried to do something similar and found a
> good way to share some of these files across multiple apps.

We've considered (but haven't implemented) something where each 
application would ask for a URL for a resource.  I suppose you could 
shoehorn this into url_for and Routes, though I probably wouldn't; I'd 
just do something like, um, my_url_for('PackageName', 'filename'), e.g., 
my_url_for('MochiKit', 'DOM.js').  Then unless configured it'd use the 
copies in public/, but with some extra configuration (probably taken 
from a common [DEFAULT] block or something) it'd return the URLs for 
some common location (e.g., http://static.mysite.com/PackageName/filename).

To go alongside this, I'd want some declarative way to indicate what 
files I have, what version they are, and what their package is.  E.g., 
something like (in setup.py):

   resource_files = """
   MochiKit-1.1 = mypackage/public/MochiKit/
   """

Then some system might copy or symlink in those files into the static 
area on installation.  Or maybe I'd go all webby with it, as I have been 
inclined to do, and say that /application/.admin/resource-list should 
return some kind of links to all the resource files that might be 
needed, and I'd start up and grab all the files and copy them over, then 
somehow tell the app where they were.  But that's a little more fuzzy to 
me at this point.


-- 
Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org
             | Write code, do good | http://topp.openplans.org/careers

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to