[modwsgi] Re: wsgi info()

2008-09-23 Thread Manuzhai

Heh, I just made this info.wsgi up yesterday:

def application(env, respond):
respond('200 OK', [('Content-Type', 'text/plain')])
for k, v in sorted(env.iteritems()):
yield '%s: %r\n' % (k, v)

I've wanted this before, and since I always used to keep an info.php
lying around, as well, I wrote this.

Of course this is really very basic output: http://xavamedia.nl/info/

Still kind of useful, to me at least.

Cheers,

Dirkjan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---



[modwsgi] Re: wsgi info()

2008-09-22 Thread Graham Dumpleton

2008/9/23 Brian Smith [EMAIL PROTECTED]:

 Graham Dumpleton wrote:
 2008/9/20 Carl Nobile [EMAIL PROTECTED]:
 If this existed, you would still need to have a WSGI script
 file that invokes it. The problem though is that core
 mod_wsgi is C code only and want to keep it that way. Ie.,
 don't want for it to be required to install separate Python
 modules as well. A lot of the problems people had with
 mod_python was because it was installing both an Apache
 module and Python modules into different places. I don't
 though cherish writing a WSGI application in C code.

 You could write the module in Python, then preprocess the source into a C
 source file that contains the source in a char[] array, and then load the
 source code into the interpreter. Actually, since mod_wsgi is tied to a
 specific version of Python you could embed the pyc file instead of the
 source file.

 I would prefer for mod_wsgi to load such modules only when they are actually
 imported by the application (script), since most applications will never
 need them.

It is only loading an empty __init__.py and it only does it once at
time interpreter is created. I want to keep this so that I can if need
be extend what mod_wsgi internally does through Python modules shipped
with  mod_wsgi or separately. The overhead of is inconsequential,
although am sure you are probably thinking about security issues as
well. ;-)

Graham

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---



[modwsgi] Re: wsgi info()

2008-09-19 Thread Graham Dumpleton

2008/9/20 Carl Nobile [EMAIL PROTECTED]:
 mod_wsgi is not a framework, so don't expect it to generate web pages for
 you it is a way of using WSGI (Web Service Gateway Interface) with apache
 only, and is very light weight compared to other alternatives. You could get
 what you want from something like Django which would then sit on top of
 mod_wsgi. You're still going to be writing some code however.

Even so, I have thought about having in mod_wsgi a mini WSGI
application which could be referenced from embedded mod_wsgi module
that exists which would dump out some information. This would be
useful as a means of just verifying in what context your application
is running, eg. prefork/worker, embedded/daemon, multithreaded,
os.environ, wsgi environ etc etc.

If this existed, you would still need to have a WSGI script file that
invokes it. The problem though is that core mod_wsgi is C code only
and want to keep it that way. Ie., don't want for it to be required to
install separate Python modules as well. A lot of the problems people
had with mod_python was because it was installing both an Apache
module and Python modules into different places. I don't though
cherish writing a WSGI application in C code.

What will more likely happen is that have always see having a parallel
package called mod_wsgi_py which is a bunch of Python utility modules
which would be useful with mod_wsgi, but not a mandatory requirement.
For example, WSGI application that can dump out system information,
WSGI middleware for debugging etc etc.

The current C code in mod_wsgi already caters for this existing in
that when mod_wsgi is started it will try and import Python 'mod_wsgi'
module and if exists, then overlay Apache module specific information
on top of that module, else it will create in memory Python module
instance for 'mod_wsgi' and stick the Apache module specific
information in that. I just need to ship the 'mod_wsgi_py' package
this was designed for. :-)

Graham

 -Carl

 On Fri, Sep 19, 2008 at 10:35 AM, Lukasz Szybalski [EMAIL PROTECTED]
 wrote:

 Hello,
 Is there a way from modwsgi to get something similar to this:

 http://www.franklindigitalproperties.com/php_info.php

 especially the part that lists all the related modules.

 Thanks,
 Lucas




 --
 Python and OpenOffice documents and templates
 http://lucasmanual.com/mywiki/OpenOffice
 Fast and Easy Backup solution with Bacula
 http://lucasmanual.com/mywiki/Bacula





 --
 ---
 Carl J. Nobile (Software Engineer)
 [EMAIL PROTECTED]
 ---

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---



[modwsgi] Re: wsgi info()

2008-09-19 Thread Carl Nobile
Graham, I like your approach to this it will keep things very decoupled and
would still allow a developer to generate stats on what is going on inside
mod_wsgi. It would be cool to start seeing its use in something like Djangos
admin. The assumption here is that you would provide a Python API into the
guts of mod_wsgi?

-Carl

On Fri, Sep 19, 2008 at 9:48 PM, Graham Dumpleton 
[EMAIL PROTECTED] wrote:


 2008/9/20 Carl Nobile [EMAIL PROTECTED]:
  mod_wsgi is not a framework, so don't expect it to generate web pages for
  you it is a way of using WSGI (Web Service Gateway Interface) with apache
  only, and is very light weight compared to other alternatives. You could
 get
  what you want from something like Django which would then sit on top of
  mod_wsgi. You're still going to be writing some code however.

 Even so, I have thought about having in mod_wsgi a mini WSGI
 application which could be referenced from embedded mod_wsgi module
 that exists which would dump out some information. This would be
 useful as a means of just verifying in what context your application
 is running, eg. prefork/worker, embedded/daemon, multithreaded,
 os.environ, wsgi environ etc etc.

 If this existed, you would still need to have a WSGI script file that
 invokes it. The problem though is that core mod_wsgi is C code only
 and want to keep it that way. Ie., don't want for it to be required to
 install separate Python modules as well. A lot of the problems people
 had with mod_python was because it was installing both an Apache
 module and Python modules into different places. I don't though
 cherish writing a WSGI application in C code.

 What will more likely happen is that have always see having a parallel
 package called mod_wsgi_py which is a bunch of Python utility modules
 which would be useful with mod_wsgi, but not a mandatory requirement.
 For example, WSGI application that can dump out system information,
 WSGI middleware for debugging etc etc.

 The current C code in mod_wsgi already caters for this existing in
 that when mod_wsgi is started it will try and import Python 'mod_wsgi'
 module and if exists, then overlay Apache module specific information
 on top of that module, else it will create in memory Python module
 instance for 'mod_wsgi' and stick the Apache module specific
 information in that. I just need to ship the 'mod_wsgi_py' package
 this was designed for. :-)

 Graham

  -Carl
 
  On Fri, Sep 19, 2008 at 10:35 AM, Lukasz Szybalski [EMAIL PROTECTED]
  wrote:
 
  Hello,
  Is there a way from modwsgi to get something similar to this:
 
  http://www.franklindigitalproperties.com/php_info.php
 
  especially the part that lists all the related modules.
 
  Thanks,
  Lucas
 
 
 
 
  --
  Python and OpenOffice documents and templates
  http://lucasmanual.com/mywiki/OpenOffice
  Fast and Easy Backup solution with Bacula
  http://lucasmanual.com/mywiki/Bacula
 
 
 
 
 
  --
 
 ---
  Carl J. Nobile (Software Engineer)
  [EMAIL PROTECTED]
 
 ---
 
  
 

 



-- 
---
Carl J. Nobile (Software Engineer)
[EMAIL PROTECTED]
---

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modwsgi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~--~~~~--~~--~--~---