Re: WSGI

2014-05-25 Thread Chris
On 05/25/2014 12:04 PM, alister wrote: > is your apache server running as root? > if so it probably should be corrected One is running as chris, the others as apache: [root@t-centos1 ~]# ps -ef|grep httpd root 1199 1 0 08:47 ?00:00:01 /usr/sbin/httpd chris 1293 1199 0 09:4

Re: WSGI (was: Re: Python CGI)

2014-05-25 Thread alister
On Sun, 25 May 2014 09:06:18 +0200, Chris wrote: > On 05/20/2014 03:52 AM, Tim Chase wrote: >> While Burak addressed your (Fast-)CGI issues, once you have a >> test-script successfully giving you output, you can use the >> standard-library's getpass.getuser() function to tell who your script >> is

Re: [WSGI] Tell Python to listen to LAN interface?

2013-03-26 Thread Gilles
On Tue, 26 Mar 2013 23:50:36 +1100, Chris Angelico wrote: >According to the docstring, the first argument to make_server() is the >host name to bind to. Using "localhost" means you're bound to >127.0.0.1, as you see. Use your LAN IP address there, or "" to bind to >all local addresses - or possibl

Re: [WSGI] Tell Python to listen to LAN interface?

2013-03-26 Thread Chris Angelico
On Tue, Mar 26, 2013 at 11:26 PM, Gilles wrote: > Hello > > I'm following this tutorial to learn about writing Python apps in > WSGI: > > http://webpython.codepoint.net/wsgi_tutorial I'm guessing you're using the initialization code from here? http://webpython.codepoint.net/wsgi_environment_dict

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Frank Millman
Frank Millman wrote: Hi all I have a question about wsgi. As far as I can tell from the spec and from the reference implementation, wsgi requires that each request from the client is responded to by one or more headers, followed by the response body. It is then ready to handle the next req

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Paul Rubin
"Frank Millman" writes: > So the question is, how can I achieve this with wsgi? If I detect that > I have received a request out of sequence, I can queue the request, > and send an empty response. I don't see how that can help, on the server side. Even if you send the responses in the right orde

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Adam Tauno Williams
On Wed, 2011-02-09 at 14:31 +0200, Frank Millman wrote: > I am dabbling with writing an ajax-style app. On occasion, I want to send > more than one message from the client to the server. It is important that > the server processes the messages in the same order that they are generated. > I have

Re: WSGI by HTTP GET

2010-10-03 Thread John Nagle
On 10/2/2010 6:15 PM, Niklasro wrote: Hello Getting a web same page with 2 or more possible "states" eg business part, private part or all parts, can you recommend a way to represent the states via HTTP GET? Feasible way could be ?business=business, ? type=business, ?business=true or others. Shou

Re: WSGI by HTTP GET

2010-10-03 Thread Niklas R
On Oct 3, 3:05 am, MRAB wrote: > On 03/10/2010 03:29, Hidura wrote:> 2010/10/2, Niklasro: > >> Hello > >> Getting a web same page with 2 or more possible "states" eg business > >> part, private part or all parts, can you recommend a way to represent > >> the states via HTTP GET? Feasible way could

Re: WSGI by HTTP GET

2010-10-02 Thread MRAB
On 03/10/2010 03:29, Hidura wrote: 2010/10/2, Niklasro: Hello Getting a web same page with 2 or more possible "states" eg business part, private part or all parts, can you recommend a way to represent the states via HTTP GET? Feasible way could be ?business=business, ? type=business, ?business=t

Re: WSGI by HTTP GET

2010-10-02 Thread Hidura
Be more specific but i recommend you, use a way in what you be very explicit eg:part='bussiness' a bool for 3 options it's very diffcult to handle. 2010/10/2, Niklasro : > Hello > Getting a web same page with 2 or more possible "states" eg business > part, private part or all parts, can you recomm

Re: wsgi with separate css file

2009-11-13 Thread Aaron Watters
RE: serving static CSS files using WSGI > ...However, this method is fragile and very inefficient. If you want to   > eventually deploy this application somewhere, I would suggest starting   > with a different method. The WHIFF WSGI tools are meant to make this kind of thing easy. In fact the qu

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
On Fri, 13 Nov 2009 08:55:33 -0800, Alena Bacova wrote: Hi, I'm using: from wsgiref import simple_server httpd = simple_server.make_server(HOST, PORT, Test) try: httpd.serve_forever() except KeyboardInterrupt: pass But I can use something else if needed. Application and htmk, css

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
On Fri, 13 Nov 2009 08:34:57 -0800, Alena Bacova wrote: Hi all, I just wanted to know if anybody tried using wsgi as a web server that would be serving html file with separate css file. I managed to make my wsgi server display only on html file ( it has got the form tag, and I'm serving

Re: wsgi silently swallows errors

2009-01-19 Thread Дамјан Георгиевски
> Consider the following wsgi app: > > def application(env, start_response): > start_response('200 OK',[('Content-type','text/plain')]) > yield "hello" > x=1/0 > yield "world" > > The result of this is that the web browser displays "hello" and an > error > message ends up in the web log

Re: wsgi silently swallows errors

2009-01-19 Thread Graham Dumpleton
On Jan 20, 8:03 am, Jean-Paul Calderone wrote: > On Mon, 19 Jan 2009 12:15:29 -0800, Ron Garret wrote: > >Consider the following wsgi app: > > >def application(env, start_response): > >  start_response('200 OK',[('Content-type','text/plain')]) > >  yield "hello" > >  x=1/0 > >  yield "world" > >

Re: wsgi silently swallows errors

2009-01-19 Thread Jean-Paul Calderone
On Mon, 19 Jan 2009 12:15:29 -0800, Ron Garret wrote: Consider the following wsgi app: def application(env, start_response): start_response('200 OK',[('Content-type','text/plain')]) yield "hello" x=1/0 yield "world" The result of this is that the web browser displays "hello" and an error m

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Diez B. Roggisch
Ron Garret schrieb: On Jan 18, 12:40 pm, "Diez B. Roggisch" wrote: Ron Garret schrieb: On Jan 18, 11:29 am, "Diez B. Roggisch" wrote: Ron Garret schrieb: I'm writing a WSGI application and I would like to check the content- length header before reading the content to make sure that the c

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Ron Garret
On Jan 18, 1:21 pm, Graham Dumpleton wrote: > On Jan 19, 6:01 am, Ron Garret wrote: > > > I'm writing a WSGI application and I would like to check the content- > > length header before reading the content to make sure that the content > > is not too big in order to prevent denial-of-service attac

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Graham Dumpleton
On Jan 19, 6:43 am, Petite Abeille wrote: > On Jan 18, 2009, at 8:01 PM, Ron Garret wrote: > > > def application(environ, start_response): > >    status = "200 OK" > >    headers = [('Content-Type', 'text/html'), ] > >    start_response(status, headers) > >    if int(environ['CONTENT_LENGTH'])>100

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Graham Dumpleton
On Jan 19, 6:01 am, Ron Garret wrote: > I'm writing a WSGI application and I would like to check the content- > length header before reading the content to make sure that the content > is not too big in order to prevent denial-of-service attacks.  So I do > something like this: > > def application

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Ron Garret
On Jan 18, 12:40 pm, "Diez B. Roggisch" wrote: > Ron Garret schrieb: > > > > > On Jan 18, 11:29 am, "Diez B. Roggisch" wrote: > >> Ron Garret schrieb: > > >>> I'm writing a WSGI application and I would like to check the content- > >>> length header before reading the content to make sure that the

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Diez B. Roggisch
Ron Garret schrieb: On Jan 18, 11:29 am, "Diez B. Roggisch" wrote: Ron Garret schrieb: I'm writing a WSGI application and I would like to check the content- length header before reading the content to make sure that the content is not too big in order to prevent denial-of-service attacks.

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Ron Garret
On Jan 18, 11:43 am, Petite Abeille wrote: > On Jan 18, 2009, at 8:01 PM, Ron Garret wrote: > > > def application(environ, start_response): > >    status = "200 OK" > >    headers = [('Content-Type', 'text/html'), ] > >    start_response(status, headers) > >    if int(environ['CONTENT_LENGTH'])>10

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Ron Garret
On Jan 18, 11:29 am, "Diez B. Roggisch" wrote: > Ron Garret schrieb: > > > > > I'm writing a WSGI application and I would like to check the content- > > length header before reading the content to make sure that the content > > is not too big in order to prevent denial-of-service attacks.  So I do

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Petite Abeille
On Jan 18, 2009, at 8:01 PM, Ron Garret wrote: def application(environ, start_response): status = "200 OK" headers = [('Content-Type', 'text/html'), ] start_response(status, headers) if int(environ['CONTENT_LENGTH'])>1000: return 'File too big' How would that work for chunked tran

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Diez B. Roggisch
Ron Garret schrieb: I'm writing a WSGI application and I would like to check the content- length header before reading the content to make sure that the content is not too big in order to prevent denial-of-service attacks. So I do something like this: def application(environ, start_response):

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Might this be a bug in wsgiref ? I will hopefully be able to do some > more testing, ... The following simple CGI script should, AFAIK, on any platform, output exactly the file specified in code. It does not on Apache 2 on Window

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently trying to port my web software AFoC > to Windows and have hit a strange problem: it seams that binary files > (PNG images in this case) get distorted by wsgiref. (I have tried both > the C

Re: WSGI spec clarification regarding exceptions

2007-05-09 Thread Graham Dumpleton
On May 10, 12:07 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On May 10, 8:26 am, Adam Atlas <[EMAIL PROTECTED]> wrote: > > > I'm trying to figure out if there's any defined behaviour in PEP 333 > > for instances where an application returns an iterable as usual > > without error, but that ite

Re: WSGI spec clarification regarding exceptions

2007-05-09 Thread Graham Dumpleton
On May 10, 8:26 am, Adam Atlas <[EMAIL PROTECTED]> wrote: > I'm trying to figure out if there's any defined behaviour in PEP 333 > for instances where an application returns an iterable as usual > without error, but that iterable's next() method eventually raises an > exception. Since any data ther

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Graham Dumpleton
Paul Boddie wrote: > Rob De Almeida wrote: > > Ben Finney wrote: > > > I was under the impression that WSGI in mod_python was a rather kludgy > > > way to do WSGI, but I don't know what the alternatives are. CGI? > > > Python http server (e.g. CherryPy)? Something else? > > > > You can use FastCGI

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Paul Boddie
Rob De Almeida wrote: > Ben Finney wrote: > > I was under the impression that WSGI in mod_python was a rather kludgy > > way to do WSGI, but I don't know what the alternatives are. CGI? > > Python http server (e.g. CherryPy)? Something else? > > You can use FastCGI or SCGI too, with Apache, lighttp

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Rob De Almeida
Ben Finney wrote: > I was under the impression that WSGI in mod_python was a rather kludgy > way to do WSGI, but I don't know what the alternatives are. CGI? > Python http server (e.g. CherryPy)? Something else? You can use FastCGI or SCGI too, with Apache, lighttpd or Cherokee. I have a short des

Re: WSGI - How Does It Affect Me?

2006-10-10 Thread uche . ogbuji
goon wrote: > > Trying to research this on the web now > > Lots of articles now appearing summarising WSGI ... > > For definitive reference: > > [0] > > Overview: > > [1] and > [

Re: WSGI - How Does It Affect Me?

2006-10-09 Thread Gregory Piñero
Thanks for all the answers everyone. It's finally starting to come together for me. Bruno, I tried reading some tutorials but perhaps I made the content out to be more complicated than it really was and got confused. So my final question is if WSGI will work on any web hosting company that suppo

Re: WSGI - How Does It Affect Me?

2006-10-09 Thread Ian Bicking
Gregory Piñero wrote: > What I'm most confused about is how it affects me. I've been writing > small CGI programs in Python for a while now whenever I have a need > for a web program. Is CGI now considered "Bad"? I've just always > found it easier to write something quickly with the CGI library

Re: WSGI - How Does It Affect Me?

2006-10-09 Thread Bruno Desthuilliers
Sybren Stuvel wrote: > Gregory Piñero enlightened us with: >> So I keep hearing more and more about this WSGI stuff, and honestly I >> still don't understand what it is exactly > > AFAIK it's a standard for web frameworks. It's not. It's a protocol for HTTP servers <-> Python web applications int

Re: WSGI - How Does It Affect Me?

2006-10-09 Thread Bruno Desthuilliers
Gregory Piñero wrote: > So I keep hearing more and more about this WSGI stuff, and honestly I > still don't understand what it is exactly A protocol for web servers/python programs interaction. Just like CGI is a protocol for web servers/whatever-language programs interactions. Gregory, you'll fi

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread goon
> Trying to research this on the web now Lots of articles now appearing summarising WSGI ... For definitive reference: [0] Overview: [1] and [2] Reference [0] python.org,

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread fumanchu
Gregory Piñero wrote: > Examples of how frameworks don't meet my needs sometimes: > 1. Working with SQL Server (Most frameworks seem to at least make it extra > work) I don't know about "most frameworks", but there are certainly some that work with SQL Server. My Dejavu ORM does SQL Server and MS

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Damjan
> So I keep hearing more and more about this WSGI stuff, and honestly I > still don't understand what it is exactly and how it differs from CGI > in the fundamentals (Trying to research this on the web now) > > What I'm most confused about is how it affects me. I've been writing > small CGI progr

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Sybren Stuvel
Theerasak Photha enlightened us with: >> > 3. Using IIS [...] >> >> Why would you want to use that monstrosity? > > Two words: "contractual obligation" That doesn't answer the question. It only makes me ask it to someone else, namely the parties involved in creating the contract. Sybren -- Sybre

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Theerasak Photha
On 10/8/06, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > > 3. Using IIS at all for that matter, does WSGI work on IIS, do any > > frameworks? > > Why would you want to use that monstrosity? Two words: "contractual obligation" -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list

Re: WSGI - How Does It Affect Me?

2006-10-08 Thread Sybren Stuvel
Gregory Piñero enlightened us with: > So I keep hearing more and more about this WSGI stuff, and honestly I > still don't understand what it is exactly AFAIK it's a standard for web frameworks. In such a framework, you receive a 'request' object, and return a 'response' object. If I'm correct, the

RE: WSGI-server in the standard distro?

2005-08-07 Thread Robert Brewer
> Having a HTTP 1.0/1.1-compliant production-grade > WSGI-only server in the distro would be sweet :-) > > I might be demanding a bit much here, but still ... To "demand" it might be a bit much, but to "expect" it...? ;) I don't think anyone's going to drop what they're doing and go code such a s