2 # vim:fileencoding=utf-8
6 from google
.appengine
.ext
import webapp
7 from google
.appengine
.ext
.webapp
.util
import run_wsgi_app
9 class CleanLog(webapp
.RequestHandler
):
11 self
.response
.headers
['Content-Type'] = 'text/html; charset=UTF-8';
12 self
.response
.out
.write(u
'''<!DOCTYPE html>
13 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
16 <input type="submit" value="确认清除所有日志"/>
17 </form>'''.encode('utf-8'))
20 logging
.warn('清除所有日志')
21 for l
in lilytalk
.Log
.all():
23 self
.response
.out
.write(u
'已删除所有日志'.encode('utf-8'))
25 class CleanUser(webapp
.RequestHandler
):
27 self
.response
.headers
['Content-Type'] = 'text/html; charset=UTF-8';
28 self
.response
.out
.write(u
'''<!DOCTYPE html>
29 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
30 <title>清除所有用户信息</title>
32 <input type="submit" value="确认清除所有用户信息"/>
33 </form>'''.encode('utf-8'))
36 logging
.warn('清除所有用户信息')
37 for l
in lilytalk
.User
.all():
39 self
.response
.out
.write(u
'已删除所有用户信息'.encode('utf-8'))
41 application
= webapp
.WSGIApplication(
43 ('/_admin/cleanuser', CleanUser
),
44 ('/_admin/cleanlog', CleanLog
),
49 run_wsgi_app(application
)
51 if __name__
== "__main__":