On Sun, Nov 9, 2008 at 1:40 PM, Lukasz Szybalski <[EMAIL PROTECTED]> wrote: >>>>> Hello, >>>>> >>>>> What needs to change to add public/ folder in front of anything that is >>>>> static. >>>>> >>>>> Currently it seems as I need to add >>>>> Alias /css/ "/path.../" >>>>> Alias /javascripts/ "/path.../" >>>>> Alias /images/ "path.../" >>>>> >>>>> This gets complicated if I deploy 2 or more apps, then I suddenly need >>>>> 3x usual number of aliases per each project. >>>>> >>>>> I would like to add >>>>> Alias /public/ "path..tomyapp/public/" >>>>> >>>>> And everything in public could be referenced via >>>>> localhost:8080/public/images/... >>>>> localhost:8080/public/css/... >> >> Maybe I didn't read this correctly. If it's working now (meaning the >> Alias handler overrides the wsgi handler), then you should be able to >> change the alias path and it would still work. In this case your >> public directory is sim >> >> >>>>> ..... >>>>> etc.. >>>>> >>>>> Can pylons template change to so that all public/static files are >>>>> served through localhost/public/ folder and not via each individual >>>>> folder? >>>>> >>>>> like to get something like this by default: >>>>> http://localhost:8080/public/images/logo.png >>>>> http://localhost:8080/public/css/style.css >>>> >>>> You can do this by putting a public directory inside your public >>>> directory. If Pylons did this by default, people wouldn't be able to >>>> put static files at the top level, including /robots.txt and >>>> /favicon.ico which must be at the top level. >>>> >>> so i I place favicon.ico and robots.txt inside of public folder right >>> now they will show up without any changes in: >>> >>> localhost/robots.txt >>> localhost/favicon.ico ?? >>> >>> >>> Another twist..... >>> Is there a variable in pylons config files that says what the prefix >>> name is? I would assume currently this variable would be set to: >>> somevar="/" points to /myapp/public/ >>> and I would be able to change it to: >>> somevar="/public/" points to /myapp/public/ >>> or >>> somevar="/public-myapp/" points to /myapp/public/ >>> >>> The reason I'm asking is that robots, favico, etc all are served by >>> apache. The existing website takes care all of it, and has its own >>> /images/ folder etc.... so now my modwsgi served app is only >>> controlling localhost/myapp but still points to /images which causes a >>> problem. I need to to point to something custom I have defined >>> localhost/public-myapp/images/ . In the future I would add another >>> separate app that would run under localhost/mysecondapp with its own >>> public folder (localhost/public-mysecondapp which I would like to >>> easily rename to public-mynewapp just by changing the config file >>> without playing around with adding folders to public or creating >>> custom functions to server static folders. >> >> You have a pretty customized configuration. > > I really don't consider this customized configuration. Its a standard > deploy action when you are extending functionality of some website > using pylons. I can never assume that pylons app will run under /. > > In the normal case, with >> the Pylons application at "/" and Apache not serving static files, >> Pylons serves the static files via the static middleware at the bottom >> of middleware.py: >> >> static_app = StaticURLParser(config['pylons.paths']['static_files']) >> app = Cascade([static_app, app]) >> return app >> >> Thus, /favicon.ico -> myapp/public/favicon.ico >>
Not sure if this can help you guys but in Turbogears 1 there were settings in app.cfg that stated the following: [/static] static_filter.on = True static_filter.dir = "%(top_level_dir)s/static" [/favicon.ico] static_filter.on = True static_filter.file = "%(top_level_dir)s/static/images/favicon.ico" Is anything like this available via pylons???? >> >> You can move the entire Pylons application under a prefix such as >> /myapp, and then the static files would also be underneath it >> (/myapp/images -> myapp/public/images). I think you have to set some >> prefix option in the INI file if you do this; search the Pylons wiki >> or list archive for an example. Then the URLs produced by url_for >> will have the correct prefix. I don't quite understand what you're >> trying to do in the last paragraph; but hopefull this will address >> some of it. I've added the prefix but the image location is still pointing to /images and not /myapp/images??? filter-with = proxy-prefix [filter:proxy-prefix] use = egg:PasteDeploy#prefix prefix = /myapp I guess this is a no go as well. Lucas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en -~----------~----~----~----~------~----~------~--~---