I'm using the Tornado framework (Python). I have the sluggable URLs working. But I have 3 different entries in the URL dispatcher. I was wondering if someone could help me transform it into one line.
This is what I have:
(r"/post/([0-9]+)/[a-zA-Z0-9\-]+", SpotHandler),
(r"/post/([0-9]+)/", SpotHandler),
(r"/post/([0-9]+)", SpotHan...
I need a web server that allows me to remove a file after it has been successfully downloaded once. Is there any way to do this with apache?
Is there another web server I can use for this task? I had already looked into Tornado for this purpose, but couldn't find a way to get an event to fire as soon as the download finished. the on_con...
I've noticed three main ways Python web frameworks deal request handing: decorators, controller classes with methods for individual requests, and request classes with methods for GET/POST.
I'm curious about the virtues of these three approaches. Are there major advantages or disadvantages to any of these approaches? To fix ideas, her...
Tornado enables win32 support by faking Python's fcntl function using SetHandleInformation, which is available via ctypes on Windows. After some other small fixes, this actually works using IronPython on Windows as well (sadly, IronPython is five times slower).
I'd like to get Tornado working on any CLI platform, such using Mono on O...
In the tornado.web module there is a function called _time_independent_equals:
def _time_independent_equals(a, b):
if len(a) != len(b):
return False
result = 0
for x, y in zip(a, b):
result |= ord(x) ^ ord(y)
return result == 0
It is used to compare secure cookie signatures, and thus the name.
But rega...
Well, the title says most of it. I'm looking to develop a chat application that will hopefully become something more, and currently I'm considering my options for what I should build it on top of.
I've taken a look at Tornado with Redis as my primary option - Tornado, being a Comet server, is perfect for long polling to retrieve the mes...
I understand that they work in some way distinct from making a thread per user. How exactly does that work?
(Does 'non-blocking' have something to do with it?)
...
I have a simple form using a POST method, consisting of a text box and a file. After hitting submit, I can see the post in Firebug as follows:
Parts multipart/form-data
posttext Some text
image BlahJFIFBlahExifBlahPhotoshopBlahBinaryStuff etc...
The Tornado handler that receives it looks like:
class NewPostHandler(BaseHand...
I have a RequestHandler object for incoming post()s. How can I find the IP of the client making the request? I've browsed most of RequestHandler's methods and properties and seem to have missed something.
...
We trying to build application that should use Comet (AJAX Push) to send notifications to individual users. Most notifications will have a fairly low timeout.
As we are running RabbitMQ, it would be easiest to send messages through AMQP. I am wondering what the best way to address individual users is, so that both the Comet server and t...
Hello,
I am using OSX 10.58 with the following versions:
curl --version
curl 7.16.4 (i386-apple-darwin9.0) libcurl/7.21.0 OpenSSL/0.9.7l zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IPv6 Largefile NTLM SSL libz
sing /Library/Python/2.5/site-packages/setupto...
Hi,
I have a simple tornado server running like this:
import json
import suds
from suds.client import Client
import tornado.httpserver
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
url = "http://xx.xxx.xx.xxx/Service.asmx?WSDL"
client = Client(url)
res...
I'm trying to adapt some tornado code to work with twisted.
Tornado's IOLoop has a function (add_callback) that will essentially call the function back in the next iteration of the loop. As far as I can tell, twisted doesn't have a direct translation of this. Is there any way to simulate this in twisted?
...
Is it possible to notify a server (make a single HTTP request with a bit of data, response is unimportant) when client leaves the page?
I'm actually using python-tornado comet application with javascript constantly keeping a request connection to the server (which gets closed and re-opened on event. Based off this: https://launchpad.net...
My php script calls an url with curl very simply :
$ch = curl_init("http://192.168.0.110:8000/guess/a b c");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$r = curl_exec($ch);
With this url, i have no problem. But if change to :
$ch = curl_init("http://192.168.0.110:8000/guess/a b cd");
I have a 400 Bad Request nginx/0.7.62 error...
I'm just starting to work on a tornado application that is having some CPU issues. The CPU time will monotonically grow as time goes by, maxing out the CPU at 100%. The system is currently designed to not block the main thread. If it needs to do something that blocks and asynchronous drivers aren't available, it will spawn another thr...
My development machine is a MacBook (which of course has kqueue). However, in production we're running Linux (which of course uses epoll). Obviously, to know the performance characteristics of my code I need to run it using epoll. That said, is performance that I see under kqueue a decent approximation of what I'll see with epoll? Or...
Tornado advertises itself as "a relatively simple, non-blocking web server framework" and was designed to solve the C10k problem. However, looking at their database wrapper, which wraps MySQLdb, I came across the following piece of code:
def _execute(self, cursor, query, parameters):
try:
return cursor.execute(query, paramet...
I am messing around with a tornado web app with which I need a bit of help. I have multiple checkboxes with the same name and I would like to POST the values of the selected one.
<input id=DB_BASED_ID name="activity" value=DB_BASED_ID type="checkbox"/>
<input id=DB_BASED_ID name="activity" value=DB_BASED_ID type="checkbox"/>
<input id=...
I was trying to set up a server configuration without having to rely on the tornado.options.parse_command_line() function, but it isn't working properly. It's being parsed, but then tornado just sits on it and doesn't do anything for it. Specifically, I'm using a server.conf file that looks like so:
log_file_prefix = "./logs/errors.log"...