Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务器上已使用改框架,同时希望在框架下实现一个页面用来绑定微信号与用户 #3

Closed
liuchang0812 opened this issue Mar 10, 2013 · 9 comments
Labels

Comments

@liuchang0812
Copy link

应该怎么办

在 robot.py 里面添加相应路由吗?

@whtsky
Copy link
Collaborator

whtsky commented Mar 10, 2013

你是想微信机器人和网页共用一个域名?

如果是的话:
用 Nginx 作反代,把一个目录代理给 WeRoBot ,其他的代理给这个页面

如果不是的话:
直接把域名丢给哪个页面就好了啊

@liuchang0812
Copy link
Author

我在sina app 上使用, 假设地址是 :robot.sinaapp.com , 我希望使用werobot中的bottle解析 robot.sinaapp.com/hello ,应该怎么写呢

@whtsky
Copy link
Collaborator

whtsky commented Mar 11, 2013

@liuchang0812 可以尝试用 Tornado 把两个 WSGI 应用 「粘」到一起:

import tornado.web
import tornado.wsgi
from robot import robot
from your_app import app

robot = tornado.wsgi.WSGIContainer(robot)
app = tornado.wsgi.WSGIContainer(app)
application = tornado.web.WSGIApplication([
    ('/robot', tornado.web.FallbackHandler, dict(fallback=robot)),
    ('.*', tornado.web.FallbackHandler, dict(fallback=robot)),
])

@whtsky whtsky closed this as completed Mar 23, 2013
@dalang
Copy link

dalang commented Mar 28, 2013

我试着采用@whtsky提到的方法来合并,提示TypeError: 'WeRoBot' object is not callable

@whtsky
Copy link
Collaborator

whtsky commented Mar 28, 2013

= =
把第一个 WSGIContainer 那里的 robot 改成 robot.wsgi 吧……
@dalang

@dalang
Copy link

dalang commented Mar 28, 2013

好像是应该robot.app。 谢谢你总是很及时的回复,big thanks @whtsky

@whtsky
Copy link
Collaborator

whtsky commented Mar 29, 2013

@dalang 客气了≥﹏≤

@whtsky
Copy link
Collaborator

whtsky commented Apr 13, 2013

@dalang 0.3.4 版本里改成 robot.wsgi 了

@dalang
Copy link

dalang commented Apr 13, 2013

好的,谢谢你的提醒。我也会及时升级我的微信机器人。:-P
在 2013-4-13 下午5:27,"whtsky" notifications@github.com写道:

@dalang https://github.com/dalang 0.3.4 版本里改成 robot.wsgi 了


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-16330228
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants