Maybe request.application would help. Is a reference, as the name says, to
the actual application.


On Tue, Jan 18, 2011 at 9:04 AM, Bob <[email protected]> wrote:

> Thanks mates, I'm going to just use init for now, will wait for the
> new routing for the future
>
> On 18 Ян, 00:47, Jonathan Lundell <[email protected]> wrote:
> > On Jan 17, 2011, at 1:06 PM, Bob wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > In attempt to get some response I'll try to clarify/simplify my
> > > question.
> >
> > > After rewriting with routes.py I have my app accessible as:
> >
> > >http://127.0.0.1/
> >
> > > But all the internal links, created with the URL() function come as:
> >
> > >http://127.0.0.1/myapp/
> >
> > > And obviously they don't work.
> >
> > > Is there no way to tell the URL() function not to prepend app name to
> > > the URLs?
> >
> > As David mentioned, you can rename your app 'init' and get some of this
> to happen. It won't delete all mention of the app name, though--only when it
> can also delete the controller and function name.
> >
> > If you don't want to change your app name, you can create (in web2py's
> base directory) a file named routes.py with nothing in it but this line:
> >
> > default_application = 'myapp'
> >
> > But to get the app name deleted on a more systematic basis, you'll need
> to write a more elaborate routes.py. There's a new version coming along, in
> beta in the trunk right now, that should be available for more general use
> pretty soon, so if you're not in a hurry, just go with one of the above
> solutions for now, and when the new rewrite logic is ready for prime time
> you can add a couple more lines in routes.py and be done with it.
> >
> > If you're in more of a hurry, use the existing rewrite logic; it's not
> going away, but it's a little trickier to set up.
>

Reply via email to