I know this thread is old but I have the exact same problem with the router
and GAE with multi language application.
I did add
- url: /(?P<a>.+?)/static/\w\{2}?/(?P<b>.+)
static_files: applications/\1/static/\2
upload: applications/(.+?)/static/(.+)
secure: optional
expiration: "365d"
to my app.yaml file but I didn't work.
I still get the /[my_app]/es/static/[my_file] not found
According to the manual it should route to:
/[my_app/static/es/[my_translated_file] but it doesn't.
Everything works perfectly in the local "rocket" server...
In my routes.py file I have :
routers = dict(
BASE=dict(default_application='corporate', default_language='en'),
corporate = dict(languages=['en', 'es'], default_language='en')
)
Any thought on what could be the problem?
Thanks a lot for the help!
El viernes, 16 de noviembre de 2012, 2:46:54 (UTC+1), c h escribió:
>
> it's in app.yaml, so it's GAE specific.
>
> On 11/15/12 17:45 , Massimo Di Pierro wrote:
> > Where is this regex?
> >
> > On Thursday, 15 November 2012 13:10:50 UTC-6, David Sorrentino wrote:
> >>
> >> Hi howesc,
> >>
> >> Testing the regex I found out the error.
> >> Intead of:
> >>
> >> url: /(?P<a>.+?)/static/\w\{2}?/(?P<b>.+)
> >>
> >>
> >> it should be:
> >>
> >> url: /(?P<a>.+?)/static/\w{2}?/(?P<b>.+)
> >>>
> >>
> >> So a backslash was making the difference! :P
> >>
> >> Thank you very much for your help, now everything works.
> >>
> >> Cheers,
> >> David
> >>
> >>
> >> On 15 November 2012 02:42, howesc <[email protected] <javascript:>>
> wrote:
> >>
> >>> the error is not obvious to me. :( can you verify that your regex
> >>> matches your URL?
> >>>
> >>>
> >>> On Tuesday, November 13, 2012 6:01:09 AM UTC-8, David Sorrentino
> wrote:
> >>>
> >>>> Hi howesc,
> >>>>
> >>>> Thanks for your reply!
> >>>>
> >>>> I tried to set the regex for my needs, but I guess that I am wrong in
> >>>> something.
> >>>> I edited the regex in this way:
> >>>>
> >>>>> - url: /(?P<a>.+?)/static/\w\{2}?/(?**P<b>.+)
> >>>>> static_files: applications/\1/static/\2
> >>>>> upload: applications/(.+?)/static/(.+)
> >>>>> secure: optional
> >>>>>
> >>>>
> >>>> Now, instead of an error, I get 2 warnings for each static file:
> >>>>
> >>>> WARNING 2012-11-13 13:54:19,604 dev_appserver_import_hook.py:**595]
> >>>>> Blocking access to static file "/home/dapids/web2py/**
> >>>>> applications/myapp/static/en/**css/bootstrap-responsive.min.**css"
> >>>>
> >>>>
> >>>> WARNING 2012-11-13 13:54:19,604 dev_appserver_import_hook.py:**595]
> >>>>> Blocking access to static file "/home/dapids/web2py/**
> >>>>> applications/myapp/static/css/**bootstrap-responsive.min.css"
> >>>>>
> >>>>
> >>>> Any thoughts?
> >>>>
> >>>> Cheers,
> >>>> David
> >>>>
> >>>>
> >>>> On 12 November 2012 23:03, howesc <[email protected]> wrote:
> >>>>
> >>>>> i don't know the full deal with the router....but it looks like the
> >>>>> path to the static files is incorrect (notice the 'en' in the path).
> you
> >>>>> can strip this out in app.yaml (my example strips out a random cache
> >>>>> busting param after the 'static/' in the path, you can modify the
> regex to
> >>>>> meet your needs):
> >>>>>
> >>>>> - url: /(?P<a>.+?)/static/.*?/(?P<b>.**+)
> >>>>> static_files: applications/\1/static/\2
> >>>>> upload: applications/(.+?)/static/(.+)
> >>>>> secure: optional
> >>>>> expiration: "1d"
> >>>>>
> >>>>> cfh
> >>>>>
> >>>>>
> >>>>> On Monday, November 12, 2012 7:19:32 AM UTC-8, David Sorrentino
> wrote:
> >>>>>>
> >>>>>> Hello everybody! :)
> >>>>>>
> >>>>>> I am developing a multi-language website deployed on GAE.
> >>>>>> For my routes.py I would like to use this configuration, shown on
> the
> >>>>>> online book (http://web2py.com/books/**defau**lt/chapter/29/04#**
> >>>>>> Parameter-**based-system<
> http://web2py.com/books/default/chapter/29/04#Parameter-based-system>
> >>>>>> ):
> >>>>>>
> >>>>>> routers = dict(
> >>>>>> BASE = dict(default_application='**myap**p'),
> >>>>>> myapp = dict(languages=['en', 'it', 'jp'],
> default_language='en'),
> >>>>>> )
> >>>>>>
> >>>>>> However, it looks like I am having some troubles with loading the
> >>>>>> static files. Indeed static files are not loaded and the console
> shows the
> >>>>>> following error:
> >>>>>> [Errno 2] No such file or directory:
> '/home/dapids/web2py/**applicati*
> >>>>>> *ons/myapp/en/static/**css/**bootstrap-responsive.min.**css'
> >>>>>>
> >>>>>> Am I doing something wrong?
> >>>>>>
> >>>>>> Cheers,
> >>>>>> David
> >>>>>>
> >>>>> --
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.