V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
kojp
V2EX  ›  问与答

关于GAE 一直显示,Status: 200 OK Content-Type: text/html; charset=utf-8

  •  
  •   kojp · 2011-12-28 19:36:26 +08:00 · 4761 次点击
    这是一个创建于 4529 天前的主题,其中的信息可能已经有所发展或是发生改变。
    其实,我是需要受到强烈批评的,因为这个小应用只是自己用。也就没在呼多了这么一行。

    都用了一年了,今天突然感觉就不爽,想把这行显示去掉~~~

    最后一行调用的代码是


    app=webapp.WSGIApplication([('/',MainPage),('/admin/write',Guestbook),('/nextpage',NextPage),('/show',ShowMe),('/admin',adminCheck)],debug=False)


    admincheck代码是:

    class adminCheck(webapp.RequestHandler):
    def get(self):
    print 'Content-Type:text/html'
    print '<html>Enter The Verify Code Plz!'
    print "<form action='admin' method='post'><input name='password' type='password'><br><input type='submit' value='Sumit'></form></html>"
    11 条回复    1970-01-01 08:00:00 +08:00
    kojp
        1
    kojp  
    OP
       2011-12-28 19:36:58 +08:00
    PS:这是第一次看GAE文档的时候,照着做的一个留言版。
    kojp
        2
    kojp  
    OP
       2011-12-28 19:48:09 +08:00
    呃。。我提的问题太多了?还是太简单了~~~莫非V2EX的帖子排序机制改了?
    alsotang
        3
    alsotang  
       2011-12-28 22:36:03 +08:00
    你想问什么?
    for4
        4
    for4  
       2011-12-28 22:38:36 +08:00
    @kojp 没看到你的问题啊~~~
    kojp
        5
    kojp  
    OP
       2011-12-29 01:20:00 +08:00
    程序正常,但输出会多这行信息,并且不知道在哪里可以去掉。。

    Status: 200 OK Content-Type: text/html; charset=utf-8
    aveline
        6
    aveline  
       2011-12-29 01:29:27 +08:00
    print 'Content-Type:text/html'

    ?这里
    kojp
        7
    kojp  
    OP
       2011-12-29 01:45:16 +08:00
    我懂了。。。肯定和这行有关。 print 'Content-Type:text/html'

    只是如何解决?
    CoX
        8
    CoX  
       2011-12-29 10:40:28 +08:00
    @kojp 去掉那行,另外 print 都换成 self.write('balabala')吧
    kojp
        9
    kojp  
    OP
       2011-12-29 14:43:50 +08:00
    @Cox试试~~~~
    kojp
        10
    kojp  
    OP
       2011-12-29 14:52:08 +08:00
    @CoX

    不靠谱~~~
    kojp
        11
    kojp  
    OP
       2011-12-29 15:01:40 +08:00
    @CoX

    self.response.out.write('balabala')

    搞定~~~

    可是这是为什么呢? 为什么print就不行~~是不是其它的地方有‘开关’可以关掉head信息的显示?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4965 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 08:30 · PVG 16:30 · LAX 01:30 · JFK 04:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.