web.py

web.py on Google App Engine

孤街醉人 提交于 2019-12-03 13:44:17
问题 I'm trying to get a web.py application running on GAE. I hoped that sth like the following might work import web from google.appengine.ext.webapp.util import run_wsgi_app [...] def main(): app = web.application(urls, globals()) run_wsgi_app(app) But obviously the app object doesn't conform with the run_wsgi_app function's expectations. The error msg says sth like app has no __call__ function , so I tried passing app.run instead, but that didn't work either. How can I make the call to run_wsgi

Using web.py as non blocking http-server

守給你的承諾、 提交于 2019-12-03 12:42:49
问题 while learning some basic programming with python, i found web.py. i got stuck with a stupid problem: i wrote a simple console app with a main loop that proccesses items from a queue in seperate threads. my goal is to use web.py to add items to my queue and report status of the queue via web request. i got this running as a module but can´t integrate it into my main app. my problem is when i start the http server with app.run() it blocks my main loop. also tried to start it with thread.start

webpy开发笔记01-调试模式下异常捕捉问题

你离开我真会死。 提交于 2019-12-03 08:43:01
最近用webpy开发web应用,不出所料刚开始果然遇到很多未知问题,这里总结一下。 调试模式下异常捕捉问题,在开发过程中我在操作数据库是老是遇到以下的这个问题(实际上所有异常都报这个错误...) File "D:\����\eclipesWork\python\PyTest\src\web\debugerror.py", line 305, in debugerror return web._InternalError(djangoerror()) File "D:\����\eclipesWork\python\PyTest\src\web\debugerror.py", line 295, in djangoerror return t(exception_type, exception_value, frames) File "D:\����\eclipesWork\python\PyTest\src\web\template.py", line 881, in __call__ return BaseTemplate.__call__(self, *a, **kw) File "D:\����\eclipesWork\python\PyTest\src\web\template.py", line 808, in __call__ return self.t(*a, *

Google app engine users Auth: Djangoappengine Vs Web2py Vs Webpy

China☆狼群 提交于 2019-12-03 07:31:55
I'm going to develop a small web application on Gae with a registration section, login\logout and stuff like that. Since Google app Engine does not support session out of the box and I don't want to restrict access using google Accounts, I am forced to pick a Framework that offers this kind of facilities. My choices are: Web2py Djangoappengine Webpy Reading its book, Web2py seems to offer session object and has a good access control, offering an Auth class that implements Role-Based Access Control . I don't know Djangoappengine yet but I suppose it offers Django Auth . Webpy works on appengine

No module named utils error on compiling py file

偶尔善良 提交于 2019-12-03 07:30:26
I'm trying to run a .py file through the command prompt using the command "python filename.py". I've already set the environment variables for python after I installed it, so I don't get any error when I type python. The file I'm running imports a few directories, all of which are preexistent in the same directory as the file I'm running, apart from the file web.py, which I can't seem to locate in the directory, so I'm assuming it's somewhere inside the python package, I have downloaded. But, I couldn't find it there either, so would I need to install an extension for python for the web.py

Using web.py as non blocking http-server

a 夏天 提交于 2019-12-03 02:10:21
while learning some basic programming with python, i found web.py. i got stuck with a stupid problem: i wrote a simple console app with a main loop that proccesses items from a queue in seperate threads. my goal is to use web.py to add items to my queue and report status of the queue via web request. i got this running as a module but can´t integrate it into my main app. my problem is when i start the http server with app.run() it blocks my main loop. also tried to start it with thread.start_new_thread but it still blocks. is there an easy way to run web.py´s integrated http server in the

web.py 0.3 新手指南

怎甘沉沦 提交于 2019-12-02 21:56:17
开始 你知道 Python 同时你希望制作一个网站。 那么web.py正好提供了一种简单的方法。 如果你希望读完整个指南, 你需要安装Python, web.py, flup, psycopg2, 和Postgres (或者等价的数据库和Python驱动)。 详细,可以查看 webpy.org . 如果你已经有了一个web.py项目,请看看升级 页面的相关信息。 准备开始。 URL 处理 任何网站最重要的部分就是它的URL结构。你的URL并不仅仅只是访问者所能看到并且能发给朋友的。它还规定了你网站运行的心智模型。在一些类似 del.icio.us 的流行网站 , URL甚至是UI的一部分。 web.py使这类强大的URL成为可能。 在开始你的web.py程序之前,打开一个文本文件(文件名为code.py)输入: import web 这条语句会导入web.py模块。 现在我们需要把我们的URL结构告诉web.py。让我从下面这个简单的例子开始: urls = ( '/', 'index' ) 第一部分是匹配URL的 正则表达式 ,像/、/help/faq、/item/(\d+)等(\d+将匹配数字)。圆括号表示捕捉对应的数据以便后面使用。第二部分是接受请求的类名称,像index、view、welcomes.hello (welcomes模块的hello类),或者get_\1。\1

HTTP 303 (SeeOther): GET Works, POST Fails

我的未来我决定 提交于 2019-12-02 06:33:02
问题 I am trying to perform a simple action: POST to a URL Return HTTP 303 (SeeOther) GET from new URL From what I can tell, this is a pretty standard practice: http://en.wikipedia.org/wiki/Post/Redirect/Get Also, it would seem that SeeOther is designed to work this way: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 I'm using web.py as my server-side controller, but I suspect that it's not the issue. If I GET, SeeOther works flawlessly as expected. If I POST to the same URL, the

HTTP 303 (SeeOther): GET Works, POST Fails

你离开我真会死。 提交于 2019-12-02 02:05:16
I am trying to perform a simple action: POST to a URL Return HTTP 303 (SeeOther) GET from new URL From what I can tell, this is a pretty standard practice: http://en.wikipedia.org/wiki/Post/Redirect/Get Also, it would seem that SeeOther is designed to work this way: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 I'm using web.py as my server-side controller, but I suspect that it's not the issue. If I GET, SeeOther works flawlessly as expected. If I POST to the same URL, the browser fails to redirect or load anything at all. Thinking it was a browser issue, I tried both IE9

Streaming large file from Heroku fails after 30 seconds timeout

扶醉桌前 提交于 2019-12-01 19:54:12
I have a python web worker that streams a large file upon client request. After 30 seconds the connection is terminated by Heroku. I'm using web.py and yielding new output. According to Heroku docs: Cedar supports HTTP 1.1 features such as long-polling and streaming responses. An application has an initial 30 second window to respond with a single byte back to the client. However, each byte transmitted thereafter (either received from the client or sent by your application) resets a rolling 55 second window. If no data is sent during the 55 second window, the connection will be terminated. I