wsgi

Best XMPP Library for Python Web Application

Hi, I want to learn how to use XMPP and to create a simple web application with real collaboration features. I am writing the application with Python(WSGI), and the application will require javascript enabled because I am going to use jQuery or Dojo. I have downloaded Openfire for the server and which lib to choose? SleekXMPP making tro...

How do I get the remote user agent inside a Genshi template when using Trac, and WSGI?

I'm trying to do some customization of a Trac project management website and have run into an interesting problem. The project has a set of images that are both SVG and PNG. The SVG images have numerous advantages including multiple hyperlinks and a smaller transmitted size against PNG which is bigger and can only link to a single docu...

Python Selector (URL routing library), experience/opinions?

Does anyone have opinions about or experience with Python Selector? It looks great, but I'm a bit put off by its "Alpha" status on pypi and lack of unit tests. I mostly like that its simple, self contained, and pure WSGI. All other url routers I've found assume I'm using django, or pylons, or paste, or pull in lots of other dependenci...

Pip + WSGI import errors

when i deploy my apps that worked fine using the django test server I usually get errors for every package I installed using pip install -e ....#egg=foo. I usually do this using virtualenv, which placed the files into env/src/foo and places another file into python/site-packages (this is an example of django-css): django-css.egg-link, w...

httplib CannotSendRequest error in WSGI

I've used two different python oauth libraries with Django to authenticate with twitter. The setup is on apache with WSGI. When I restart the server everything works great for about 10 minutes and then the httplib seems to lock up (see the following error). I'm running only 1 process and 1 thread of WSGI but that seems to make no diff...

How should I perform cleanup at the end of a repoze.bfg response?

Example code for the repoze.bfg web framework performs post-response cleanup by adding a __del__ method to an object attached to the request's environ. Is there a better way to clean up database connections, etc. after the response has been completely sent to the client? ...

Error when return XML via Python Simple Web Server

I wrote a small web server using wsgiref.simple_server in python. It get and parse request via URL (environ.get('PATH_INFO')). Data return in xml format. I've test it, everything ok before return to client, xml string no problem (using print xml to view before return). With Firefox, IE, sometimes xml string show in FF, IE has error: XML...

Why would I get an intermittent UnboundExecutionError from SQLAlchemy on second WSGI request?

I am building a small WSGI application and I am having an intermittent problem with SQLAlchemy throwing an UnboundExceptionError. When it happens, it seems to happen exclusively on the second request the browser makes. Refreshing the page (and all following page view attempts) run fine. It seems to only happen on the second request. I ...

Serve wordpress blog from subdirectory with django and wsgi

Hi, I'm currently on shared hosting plan with dreamhost and have installed Django as per http://wiki.dreamhost.com/Django . However, I also have a wordpress blog that I wish to keep running in a subdirectory, i.e, site.com/blog. Is it possible to do this. Installing Django results in a passenger_wsgi.py file in the Django root directory...

Unknown Authn provider: wsgi ... fail!

I have working wsgi authentication on another server, however a second server is not accepting the same configuration and errors upon reload with the message: Syntax error on line 12 of /etc/apache2/sites-enabled/mydomain.com Unknown Authn provider: wsgi ... fail Here is the relevant portion of the config file (line 12 is WSGIAuth...

Doing something *after* handling a request in Google App Engine

I would like the GAE to do something else once my app has sent a response. The handler would look like this: class FooHandler(webapp.RequestHandler): def post(self): self.response.out.write('Bar') send_response() # this is where I need help! do_something_else() # at this point, the response should have b...

Pylons Custom Middleware return 404

Hey all I have the following code as a middleware in an pylons application: import testing.model as model import re from pylons.controllers.util import abort class SubdomainCheckMiddleware(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): if 'subdomaincheck' in envir...

Cannot solve mod_wsgi exception in Django setup

I'm working with my hosting provider to get a Django application up and running, but neither of us are very experienced and we've basically hit a complete dead end. I don't have direct access to the conf file but here's how its contents have been described to me: <IfModule mod_wsgi.c> WSGIScriptAlias /fredapp/ /home/fred/public_html/cg...

Can I use WSGI with a URI that has spaces?

I wrote a small WSGI App: def foo(environ, start_response): bar = 'Your request is %s' % environ['PATH_INFO'] status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(bar)))] start_response(status, response_headers) return [bar] ...

psp (python server pages) code under mod_wsgi?

Is there some way to run .psp (python server pages) code under apache + mod_wsgi? While we are moving towards newer wsgi based frameworks we still have some legacy code written in psp which runs under mod_python. We'd like to be able to run it on the same server that hosts other wsgi based python code. In short - is there a way to supp...

How do I build an WSGI apps built with CherryPyWSGIServer that support both HTTP and HTTPS?

I built a WSGI app and created a standalone wrapper using CherryPyWSGIServer. I see that CherryPyWSGIServer supports HTTPS but I am not sure how to support both HTTP and HTTPS together as it looks like the first server.start() blocks. How would I create two servers, one HTTP and one HTTPS, and start them both? Here is what I have now: ...

Running a PHP script inside a Python WSGI enviroment

Hi all, I have a simple PHP script that outputs a dir listing in XML format. I use it to let a flash slideshow know what files are available to show. I've just added the flash to a website that's powered by Django and the PHP file is now served up as it is, not parsed. It's in the directory with the images under my media directory. Th...

which is a minimalistic python wsgi development server with support for code reload ?

From what I can tell wsgiref - no code reload CherryPy - more than just the server mod_wsgi - all the apache overhead paste.httpserver - paste is a huge package with other stuff in it flup - same as paste, too much stuff. Spawning - never used it but seems lightweight enough. Tornado - not really wsgi + full "framework" Werkzeug - run...

How do I encode WSGI output in UTF-8?

I want to send an HTML page to the web browser encoded as UTF-8. However the following example fails: from wsgiref.simple_server import make_server def app(environ, start_response): output = "<html><body><p>Räksmörgås</p></body></html>".encode('utf-8') start_response('200 OK', [ ('Content-Type', 'text/html'), ('...

Spawning WSGI example (practical approach to WSGI)

Hi. I'm trying to understand how WSGI works. I know I could read the specs, but I'd still want to know how do I create a spawning application? A complete "hello world". Could someone show me an example? With everything, file naming, creating the module, running it. Every and each step. Thanks. (NB: while spawning seems a great piece of...