I never know why I missed that part when I read it before. Anyway, thanks DR for your clue.
On Aug 7, 10:23 am, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Aug 7, 6:16 pm, David <ww...@yahoo.com> wrote: > > > > > > > Hello, > > > My project is Web-based and I work in Django environment on Linux. Let > > me give a Scenario first. > > > A user whose username is "peter" logins into "www.myfoo.com" online. > > After his username/password get authenticated, he arrives this webpage > > "www.myfoo.com/user_login". On this page it looks like this. > > > Welcome Peter > > (1.) Go to my profile > > (2.) Check my total credit points > > (3.) .... > > > (1.), (2.), (3), etc, are all links. If peter clicks one of them, then > > he will be redirected to a new webpage. For example, if he clicks > > (1.), then he will be transferred to webpage "www.myfoo.com/peter/ > > profile/". For this webpage there is a def (or module) "user_profile > > (request)" in View. This module needs to get this URI (or at least "/ > > peter/profile/) and parse it so that peter's profile can be retrieved > > from a database. > > > Now my question is: how can the module "user_profile(request)" get > > "peter"? Or, how can the module get the URI? > > > os.environ[...] does not work here as this is not cgi. request.user is > > not good either as it gives in-exact result. > > > Any ideas and suggestions? > > > Thanks so much. > > Surely the username is just the parameter to the user_profile > function? Getting parameters from URLs is absolutely basic Django > stuff, covered in the tutorial. I'd recommend reading that then > posting here if you have any more questions. > -- > DR.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---