On Feb 17, 2011, at 4:58 AM, Johann Spies wrote:
> On 17 February 2011 08:02, Jonathan Lundell <[email protected]> wrote:
> On Feb 16, 2011, at 9:49 PM, cjrh wrote:
> >
> > On Feb 16, 11:38 pm, Jonathan Lundell <[email protected]> wrote:
> >> [I'm reposting this message from a while back, because the new release
> >> 1.92.1 contains it for the first time. It describes some simple use cases
> >> for the new URL router. Note that there are still some things that you'll
> >> need the existing regex-based router for, but for most cases the new one
> >> should work and be easier to configure.]
> >
> > May I add this text to the book, now that the router is in the latest
> > stable release version? I don't want to step on your toes, if you
> > were planning to do this yourself soon anyway, then that's fine too.
>
> Please do. Take a look at router.example.py as well; there's at least one new
> feature there (path_prefix). I can review the material any time you're ready.
>
>
> I am afraid router.example.py did not help me a lot.
>
> What is unclear to me is how to use root_static. The documetation says:
>
> # root_static: list of static files accessed from root
> # (mapped to the current application's static/ directory)
> # Each application has its own root-static files.
>
> The example did not show any reference to an application.
>
> So do I have to list all the files all the applications will user from
> 'static' in the same list?
No, this is a special case for favicon.ico and robots.txt
By "root_static" (which I agree is a little confusing), we mean static files
like favicon.ico that are always accessed in the server root. This is simply a
list of those files (and the default list should normally be all you need) that
tells web2py which application's static directory to fetch the files from.
>
> I have two applications and at the moment have the following:
>
> # base router
>
> BASE = dict(
>
> default_application = 'kb',
>
> domains = {
>
> 'kbase.sun.ac.za' : 'kb',
>
> 'kbase' : 'kb',
>
> 'sadcpublications.sun.ac.za' : 'sadec'
>
> },
>
> applications = ['kb', 'sadec'],
> controllers = 'DEFAULT'
>
> ),
>
> Both sadec and kb makes use of a front page image:
> in sadec/static for sadec
> and in
> kb/static/images for kb
>
> While sadec shows the image kb can't find it.
>
> I have used autoroutes before but that breaks jqgrid. Now with this jqgrid
> seems to work.
>
> If I can just solve the problem of <app>/static/images it will help - that is
> until I discover something else routes.py has broken...
What are the actual URLs for the images in question? As they appear in the page
source at the browser, I mean.