If you want to sue this URL:
http://127.0.0.1:8000/ProfilePublic/~jsmith

routes should be like this:

# begin
routes_in = [
   ('/ProfilePublic/~$anything','/ProfilePublic/default/userinfo/$anything'
),
]
#end
routes_out = [
   ('/ProfilePublic/default/userinfo/$anything','/ProfilePublic/~$anything'
),
]

On Tuesday, 31 July 2012 17:21:42 UTC-5, Rob_McC wrote:
>
> Sir:
>
> Any ideas? Where I'm going wrong?
>
> Just trying to get the routing working, as per your instructions.
>
> http://127.0.0.1:8000/ProfilePublic/~jsmith
> returns 
> *invalid request
> *
> I'm on Max OX,
> I open the Package Contents. (see screen shot) and place routes
> I saw the example routing files there as well, so I assume that is where 
> it goes,
> I would sort of expected the routes.py file to be inside the application 
> directory.
>
> *Here is my routes.py file*
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> # default_application, default_controller, default_function
> # are used when the respective element is missing from the
> # (possibly rewritten) incoming URL
>
>
> # begin
> routes_in = [
>    ('/~/$anything','/app/default/userinfo/$anything'),
> ]
> #end
> routes_out = [
>    ('/app/default/userinfo/$anything','/~/$anything'),
> ]
>
>
>
> Thanks once again.
>
> Rob
>
>
>
>
>
> On Tuesday, July 31, 2012 4:13:08 PM UTC-4, Massimo Di Pierro wrote:
>>
>> ...
>>
>> Using a Twitter like syntax you can try create a web2py/routes.py file:
>>
>> # begin
>> routes_in = [
>>    ('/~/$anything','/app/default/userinfo/$anything'),
>> ]
>> #end
>> routes_out = [
>>    ('/app/default/userinfo/$anything','/~/$anything'),
>> ]
>>
>> and use http://hostname/~jsmith
>>
>> The ~ will help you avoid confusion between a username and a web2py 
>> app-name.
>>
>> On Tuesday, July 31, 2012 2:11:47 PM UTC-5, Rob_McC wrote:
>>>
>>> Haven't been able to find a solution to this on Groups - I'm NEW to 
>>> web2py, but enjoying it a great deal.
>>>
>>> Note: I learned how to make custom fields in User's table, that was easy.
>>>
>>> *Assumptions*:
>>> *User: jsmith
>>> Custom fields:  Country, Age
>>>    Country=Canada
>>>    Age=34*
>>>
>>> I want to make a few of the user's profile public - no login is required 
>>> to view SOME of the fields
>>>
>>> I know if jsmith is logged in,  he can access only his profile at:
>>> *http://somesocialwebsite/default/user/profile*
>>>
>>> *Question/problem:*
>>>
>>> *How do I make a public url like:
>>> **
>>> http://somesocialwebsite/jsmith*
>>>
>>> *return
>>> *
>>> *<html>
>>> <body>*
>>> *Some Social Website
>>> <h1>User Name: jsmith</h1>
>>> <h2>Age: 34</h2>
>>> <h3>Country: Canada</h3>* 
>>> *</body>
>>> </html>*
>>>
>>> Any help, or pointing me in the right direction would be appreciated, 
>>> thanks,
>>>
>>> Rob
>>>
>>> Reference: Adding custom fields
>>>
>>> https://groups.google.com/forum/?fromgroups#!searchin/web2py/db.auth_user$20adding$20fields/web2py/H0g7WUV7ubg/7AxpjU_tFL8J
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 



Reply via email to