且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

网络应用程序共享相同的内存存储空间

更新时间:2022-12-21 20:57:00

Solution is simple: Stop setting class variables in web development! :) Web requests are stateless, it's mean you never know what's happen between requests - between setting class variable and redirect.

Use database to store temporary data with user login/name (or use hashing/random for security) or send values by parameters (hidden or after '?') to other html page. Using database is better, if you don't want this then send values (hidden in html) over http. Here is one version of solution (without database):

1.Use normal html form and write handler for this form - question page.

2.In handler write get method like this:

def post(self, some_parameters):
   ...
   self.render('homepage.html', {'ans_no': ans_no,\
                                'uans_no': uans_no ...}) 

3.homepage.html have to be template for showing results

相关阅读

技术问答最新文章