这是一个创建于 2839 天前的主题,其中的信息可能已经有所发展或是发生改变。
127.0.0.1 - - [17/Sep/2016 19:47:43] "GET /index HTTP/1.1" 200 -
每次 web 用户访问某个页面如 /index ,都会有这个 [17/Sep/2016 19:47:43] 请求时间,我想保存下来作为用户访问的最近一次时间记录。 这个请求时间要怎么获取啊?(环境: Python / Flask )
4 条回复 • 2016-09-18 18:15:04 +08:00
![SayHaHa](https://cdn.v2ex.com/avatar/c40c/f1cd/149487_normal.png?m=1448959485) |
|
1
SayHaHa 2016-09-18 08:27:38 +08:00 via Android
你在 /index 的 view 里添加一个获取当前时间的逻辑不就行了
|
![finab](https://cdn.v2ex.com/avatar/a522/9f1c/58816_normal.png?m=1699093731) |
|
2
finab 2016-09-18 08:44:22 +08:00 via iPhone
|
![rogwan](https://cdn.v2ex.com/avatar/d173/67b0/12857_normal.png?m=1586860954) |
|
3
rogwan 2016-09-18 09:20:59 +08:00
@ SayHaHa 我跑去 session cookie 里面去找 =_=! 舍近求远。。。
|
![xiaooloong](https://cdn.v2ex.com/avatar/c763/8183/73919_normal.png?m=1560752416) |
|
4
xiaooloong 2016-09-18 18:15:04 +08:00
nginx 的日志么?
试试换成 openresty 搞?
|