wsgi

uWSGI with Cherokee: first steps

Has anyone tried using uWSGI with Cherokee? Can you share your experiences and what documents you relied upon the most? I am trying to get started from the documentation on both (uWSGI and Cherokee) websites. Nothing works yet. I am using Ubuntu 10.04. Edit: To clarify, Cherokee has been working fine. I am getting the error message: ...

wsgi-served page does not refresh

I recently got my first app to work in uWSGI with Cherokee. I used the following code taken from the uWSGI docs: def application(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) yield 'Hello World\n' The page correctly reads Hello World. When I change that text to New Thing and refresh, nothing ...

Django apache-wsgi configuration problem

Hi, I am trying to get my Django project running on the production server. I setup the environment using pip, so it is identical to the development environment where everything is running fine. The only difference is that I don't use virtualenv on production, because this project is the only one that is going to run on production. Als...

Python: Run WSGI server from inetd?

As the title suggests, is it possible to run a WSGI server from (x)inetd? ...

uwsgi + django via Nginx - uwsgi settings/spawn?

I am leaning towards uwsgi+nginx for my Django app, can anyone share the best method for starting up my uwsgi processes? Does anyone have experience tuning uwsgi? ...

Is there a way to set the value of wsgi.input when testing?

When using wsgiref.util.setup_testing_defaults() to set up a WSGI environ is it possible to set the wsgi.input value so that one can test HTTP POST requests? Investigating the wsgi.input value created by setup_testing_defaults() shows that it's a wsgi.validate.InputWrapper object with read, readline, readlines, input, close, and __iter_...

How do I do a Rails style before_filter with Google App Engine?

The app is setup as a basic WSGI application. I'm just trying to call a function before the requestHandler is run. I would like something very much like the way before_filter works in Rails. Thanks. ...

Seeing what gets written to stderr in Python web site using FastCGI

I am working on a website, hosted on DreamHost, using Python. For a while, I was using their default setup, which runs Python scripts using CGI. It worked fine, but I was worried that if I get a lot of traffic, it would run slow and use a lot of memory, so I switched it over to FastCGI using this module. Overall, it still works fine, bu...

Calling a python function over the web using AJAX?

Hi, I want to send a string to a python function I have written and want to display the return value of that function on a web page. After some initial research, WSGI sounds like the way to go. Preferably, I don't want to use any fancy frameworks. I'm pretty sure some one has done this before. Need some reassurance. Thanks! ...

mod_wsgi + apache not multithreaded, why?

WSGI application # coding: utf-8 import time def application(environ, start_response): status = '200 OK' output = str(time.time()) time.sleep(5) output += ' -> ' + str(time.time()) response_headers = [('Content-type', 'text/html; charset=utf-8'), ('Content-Length', str(len(output)))] s...

soaplib problems with XML characters in string payload

I've created a simple SOAP web service using soaplib and run into an issue in which SOAP parameters sent including ampersands or angle brackets are ignored, even when escaped. Whether the method is set up to accept a primitive string or a primitive of type 'any', any of those characters introduced result in a webfault (using suds) of th...

Is there a way to automate restarting the python process after every change I make to Django models?

I am using Django with Passenger on Dreamhost. Every time I make a change to models, settings or views I need to pkill python from a terminal session. Does anyone know of a way to automate this? Is this something that Passenger can do? Thanks. ...

Passing in a variable into WSGI

Hi everyone, I am currently using twisted with wsgi. I wrote my own Engine class which powers the backend to all the logic in my application. Is there an easier method that would allow me to do the following? in run.py #Django setup sys.path.append("spontivity_web") os.environ['DJANGO_SETTINGS_MODULE'] = 'spontivity_web.settings' from ...

How do I access environ variables in Django's wsgi?

I am using this code to run django within twisted. from django.core.handlers.wsgi import WSGIHandler def wsgi_resource(): pool = threadpool.ThreadPool() pool.start() # Allow Ctrl-C to get you out cleanly: reactor.addSystemEventTrigger('after', 'shutdown', pool.stop) real_wsgi_app = WSGIHandler() def my_wsgi_wrap...

Web gateway interfaces in Python 3.

I've finally concluded that I can no longer afford to just hope the ongoing Py3k/WSGI disasterissues will be resolved anytime soon, so I need to get ready to move on. Unfortunately, my available options don't seem a whole lot better: While I find a few different Python modules for FastCGI scattered around the web, none of them seem to...

nginx/wsgi/Virtualenv/pip/yolk/django configuration add new module

I'm having a small problem with my setup. I'm quite new to the django world so bare with me. A friend who is familiar has set up a VPS (Ubuntu) for my project. I'm now on my own trying to add a new module (south) so I can use manage.py migrate When the virtualenv was deactivated I installed the module sudo pip -E /var/www/env/e...

Embedded WSGI backend for Python desktop app using webkit

Disclaimer: I'm not very familiar with any of the things mentioned in the question title. Would it be possible to use a browser control (like Webkit) as a frontend for a WSGI app (using a framework like Flask) without starting a local WSGI server? Basically the requests and responses are managed by a middle layer between the HTML UI an...

GAE self.request.environ and server host

I'm trying to obtain the base URL (hostname) of the server in which my appengine app is running on. Ie something along the lines of wsgiref.util.application_uri(self.request.environ) However it's returning the PATH_INFO which I do not want. Perhaps I'm missing something but even this article states the path info should be omitted. h...

In Django, how do I allow print statements to work with Apache WSGI?

"print" only works in development server. But what if I want it to work in Apache? Just in case I forget to comment it out...I want to be able to go smoothly without causing errors. (Just print to nothing) ...

Can't get mod_wsgi and Apache with Django to work

This is the error I get in my Apache error log: [Sun Aug 22 16:52:06 2010] [error] [client 127.0.0.1] ImportError: No module named settings This is my .wsgi file, per this blog post: import sys sys.path.insert(0, '/home/wot/django-projects/aedo') import settings import django.core.management django.core.management.setup_environ(setti...