Hello:
I know the method
self.get_argument() , but, I also has some problems as follows:
1. if I have an URL like this
www.example.com/login?refer=value1&server=value2&action=add . OK.
Now, I want get the keys: refer, server, action, How can I do that?
And more, How can I handler those values in the RequestHandler?
I have try this, but it doesnot work:handler = [(r"/login", LoginHandler)] # I do not how write the regxp of Url_spec
class LoginHandler(BaseRequestHandler):
def get(self):
refer = self.get_argument("refer", None)2. if I have an URL like this
www.example.com/user/{{ User-Name }} ?action=editemail, and
{{ User-Name }} means ANY words
as abcdefg.
OK, Now, I want to get the
{{ User-Name }} in my Handler, and as the Problem 1, how can I
And more, I have read the source code in the demo named blog, but I do not know how to pass the value after ?, which is
?action=editemail
this is my code example:
handler = [(r"/user/(/.+)", UserHandler)]
class UserHandler(BaseRequestHandler):
def get(self, username): # Now the {{ User-Name }} pass to Here
actiion = self.get_argument("action", None) # It do Not work
I really need a Tornado's Document in detail. It is really import thing to a new guy that is new Tornado.
I like Tornado more than Django, Django is convenient but its source code is hard to read to me. Tornado
is just simple and brief to understand, this is the reason I choise it. but sometimes I must pay for my choise,
because Tornado's code samples are too little and Now I must ask some stupid questions in the mail list.
I hope Tornado will have a document in detail, and I do not need to read the source code to find out how to
get the
User-Agent by the method
self.request.headers["User-Agent"] . Not all will want to read the source
code and A document in detail is needed for the new, even it seems to waste a lot of time, especially to our Good
guys have write Python some years.
OK, in the end, I want to say, I am not a pythonic code geek, I just have a computer and just want to write some
code for fun. HAHA.
--
--------------------------------------------------------------------
HengZhou
---------------------------------------------------------------------
--