Adi, thanks very much, works well.
I will probably want to remove "profile" from url so user can just
have www.myapp.com\username but I will
need to think how this can be done:)

On Jun 4, 5:16 pm, Adi <[email protected]> wrote:
> Assuming your application is in init folder - the following might work
>
> routes_in=(
>   ('/profile/$args', '/init/default/profile/$args'),
>   ('/profile/$args/(?P<any>.*$)', '/init/default/profile/$args/
> \g<any>'),
> )
>
> routes_out=(
>   ('/init/default/profile/$args', '/profile/$args'),
>   ('/init/default/profile/$args/\g<any>', '/profile/$args/(?P<any>.*
> $)'),
> )
>
> On Jun 4, 6:23 pm, ChrisM <[email protected]> wrote:
>
> > anyone?
>
> > On Jun 3, 2:29 pm, ChrisM <[email protected]> wrote:
>
> > > Having trouble gettingroutesto work (not used before) for instance
> > > as a test I did:
>
> > > inroutes.py:
> > > routes_in = (  ('/profile/*', '/init/default/userprofilepage/*'),)
> > > routes_out = (  ('/init/default/userprofilepage/*', '/profile'),)
>
> > > in default controller:
> > > def userprofilepage():
> > >     userprofile request.args(0)
> > >     return dict(userprofile=userprofile)
>
> > > in userprofilepage.html:
>
> > > {{extend 'layout.html'}}
> > > <h1>{{=userprofile}}</h1>
>
> > > get invalid request?
>
> > > any help appreciated.
> > > chrism
>
> > > On Jun 3, 6:08 am, Adi <[email protected]> wrote:
>
> > > > You could use an argument.
>
> > > >www.myapp.com/userprofilecanbemappedto a controller/method 
> > > >likewww.myapp.com/app/profiles/show/userprofile
>
> > > > where app = application, profiles = controller, show = function,
> > > > userprofile is an argument accessed by request.args(0) inside "show".
> > > > You can use it to query database according to that user.
>
> > > > In order to hide "app/profiles/show" from url follow the usualroutes.py 
> > > > mapping  (its given on some other post here) assuming you
> > > > have only one app on the server.
>
> > > > On Jun 2, 9:31 pm, ChrisM <[email protected]> wrote:
>
> > > > > For isntance I have RPX login which creates user profile for each
> > > > > logged in user.
> > > > > I would like to give each one of these users there own homepage (i.e.
> > > > > like twitter) which could be
> > > > > dynamically created.
> > > > > So I thought the first task was to see how thiscould be mapped,
> > > > > perhaps by querying db.profile and then mapping throughroutes.py.
>
> > > > > chrism
>
> > > > > On Jun 2, 3:46 pm, mdipierro <[email protected]> wrote:
>
> > > > > > Can you explain more?
>
> > > > > > On Jun 2, 8:00 am, ChrisM <[email protected]> wrote:
>
> > > > > > > I searched through the list but couldn't find any discussion on 
> > > > > > > this
> > > > > > > topic.
>
> > > > > > > Any ideas how the following can be achieved withroutes.py
>
> > > > > > >www.appname.com\userprofilename
>
> > > > > > > I am guessing that there would need to be a db.auth lookup to 
> > > > > > > match
> > > > > > > the userprofilename
> > > > > > > and then pass that to a generic controller, but how?
>
> > > > > > > Help Aprreciated
>
> > > > > > > ChrisM- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -

Reply via email to