Re: Python simple web development

2009-06-27 Thread Kee Nethery
Until I'm an experience Python coder, I'm sticking with built-in  
packages only. My simple CGI is:



#!/usr/bin/env python

# this simple CGI responds to a GET or a POST
# send anything you want to this and it will parrot it back.

# a line that starts with #2 is the old-style code you should use that  
works
# with versions less than Python 2.6. I'm using 2.6.2 and am trying to  
use

# code that works with Python 3.x and up.

import cgi ## so that I can be a web server CGI
import os ## only purpose is for getting the CGI client values like IP  
and URL


def main():
# create the output variable and then add stuff to it that gets  
returned

cgiResponseData = 'stuff from the client browser connection:\n'

# so that there is something to return, go through the CGI client  
data

#2 for cgiKey in os.environ.keys():
for cgiKey in list(os.environ.keys()):
# for each client data value, add a line to the output
cgiResponseData = cgiResponseData + \
str(cgiKey) + ' = ' + os.environ[cgiKey] + '\n'

# this says give me a list of all the user inputs posted to the cgi
formPostData = cgi.FieldStorage()

cgiResponseData = cgiResponseData + '\n\nstuff from the URL POST  
or GET:\n'


# cycle through those inputs and output them right back
#2 for keyValue in formPostData:
for keyValue in list(formPostData):
cgiResponseData = cgiResponseData + \
str(keyValue) + ' = ' + formPostData[keyValue].value + '\n'

#2 print 'Content-type: text/html'
#2 print
#2 print cgiResponseData
print('Content-type: text/html')
print('')
print(cgiResponseData)

main()


--
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread laplacia...@gmail.com
On Jun 27, 2:25 am, "laplacia...@gmail.com" 
wrote:
>
> As Thomas suggests, maybe have a look at Werkzeug ...

Typo: s/Thomas/Petr/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread laplacia...@gmail.com
On Jun 26, 6:08 pm, Thomas Allen  wrote:
> On Jun 25, 3:29 am, Private Private  wrote:
>
>
> > Can you suggest anything ?
>
> I don't think anything's lighter than web.py.
>
> http://webpy.org/
>

My impression is that webpy is intended for experienced users who
might otherwise just write all their own code, but who might as well
use webpy instead because it's there. It's tutorial is very brief, and
(if memory serves) webpy didn't even have any docs at all for a while.

As Thomas suggests, maybe have a look at Werkzeug http://werkzeug.pocoo.org/
. They've got substantial docs (which look quite good) and even a
nifty screencast.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread Petr Messner
What about Werkzeug? I like its simplicity (well, basically everything
I need are WSGI request/response objects :) + some templating
library).

Petr


2009/6/25 Private Private :
> Hi,
>
> I am looking for a python library which will allow me to do a simple
> web development. I need to use
> some forms (but nice looking :-) ), creating images based on input
> from those forms, etc. I have read a bit about Django and TurboGears
> but I am afraid that this is too big for my requirements (am I
> wrong ?).
>
> Can you suggest anything ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread Thomas Allen
On Jun 25, 3:29 am, Private Private  wrote:
> Hi,
>
> I am looking for a python library which will allow me to do a simple
> web development. I need to use
> some forms (but nice looking :-) ), creating images based on input
> from those forms, etc. I have read a bit about Django and TurboGears
> but I am afraid that this is too big for my requirements (am I
> wrong ?).
>
> Can you suggest anything ?

I don't think anything's lighter than web.py.

http://webpy.org/

Thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread Daniel Fetchinson
>> What I've read about Django, Turbogears is that they are powerful
>> enough to create big web-based portals, applications, etc.
>> I need just simple forms without any sophisticated functionality.
>> So again: why I am wrong ?
>
> Just because something is powerful doesn't mean you can't do simple
> things with it.

But complexity typically brings in an extra overhead that the OP might
not need. I'm using turbogears for a project but for other simple
things I don't, because the all the super powerful infrastructure of
turbogears is just not necessary and slows things down without a
reason.

So I would recommend the OP against using either django or turbogears
if the project is really small and will stay small in the future. This
last point is hard to guess in advance though :)

Cheers,
Daniel

> Have a read of the first few chapters of the Django book...
>
> http://www.djangobook.com/



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread Charles Yeomans

Or you could try my approach and write your own web app.

Charles Yeomans
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-26 Thread bijoy franco
Hi,
I am learning pylons..It seems to be very simple and flexible..

Just give a try if it seems interesting for you

Thanks

Bijoy

On Fri, Jun 26, 2009 at 3:02 AM, Gabriel Genellina
wrote:

> En Thu, 25 Jun 2009 04:29:28 -0300, Private Private 
> escribió:
>
>  I am looking for a python library which will allow me to do a simple
>> web development. I need to use
>> some forms (but nice looking :-) ), creating images based on input
>> from those forms, etc. I have read a bit about Django and TurboGears
>> but I am afraid that this is too big for my requirements (am I
>> wrong ?).
>> Can you suggest anything ?
>>
>
> You may try pesto: http://pesto.redgecko.org/
>
> pesto is a very small framework (45k to download!), WSGI compliant,
> includes session management, mapping URL->function, caching, templates
> (optional, whichever you like). Minimalist but flexible.
>
> Anyway, learning to use Django isn't a bad idea.
>
> --
> Gabriel Genellina
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-25 Thread Gabriel Genellina

En Thu, 25 Jun 2009 04:29:28 -0300, Private Private 
escribió:


I am looking for a python library which will allow me to do a simple
web development. I need to use
some forms (but nice looking :-) ), creating images based on input
from those forms, etc. I have read a bit about Django and TurboGears
but I am afraid that this is too big for my requirements (am I
wrong ?).
Can you suggest anything ?


You may try pesto: http://pesto.redgecko.org/

pesto is a very small framework (45k to download!), WSGI compliant,
includes session management, mapping URL->function, caching, templates
(optional, whichever you like). Minimalist but flexible.

Anyway, learning to use Django isn't a bad idea.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-25 Thread Chris Withers

Private Private wrote:

What I've read about Django, Turbogears is that they are powerful
enough to create big web-based portals, applications, etc.
I need just simple forms without any sophisticated functionality.
So again: why I am wrong ?


Just because something is powerful doesn't mean you can't do simple 
things with it.


Have a read of the first few chapters of the Django book...

http://www.djangobook.com/

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-25 Thread Private Private
On Jun 25, 10:59 am, Chris Withers  wrote:
> Private Private wrote:
> > from those forms, etc. I have read a bit about Django and TurboGears
> > but I am afraid that this is too big for my requirements (am I
> > wrong ?).
>
> You are wrong :-)

Why ?
What I've read about Django, Turbogears is that they are powerful
enough to create big web-based portals, applications, etc.
I need just simple forms without any sophisticated functionality.
So again: why I am wrong ?

przemol
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-25 Thread samwyse
I just started with web2py (http://www.web2py.com/) for an internal-
use-only app that doesn't need to be very pretty.  Been using it for
about a week and after re-watching the tutorial, I've decided that I'm
making things way too complicated.  So today I'm going to replace a
lot of my code with some built-ins.

On Jun 25, 2:29 am, Private Private  wrote:
> Hi,
>
> I am looking for a python library which will allow me to do a simple
> web development. I need to use
> some forms (but nice looking :-) ), creating images based on input
> from those forms, etc. I have read a bit about Django and TurboGears
> but I am afraid that this is too big for my requirements (am I
> wrong ?).
>
> Can you suggest anything ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python simple web development

2009-06-25 Thread Chris Withers

Private Private wrote:

from those forms, etc. I have read a bit about Django and TurboGears
but I am afraid that this is too big for my requirements (am I
wrong ?).


You are wrong :-)


Can you suggest anything ?


http://www.djangoproject.com/

http://bfg.repoze.org/

http://pylonshq.com/

Drink whichever koolaid you like the taste of :-)

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list


Python simple web development

2009-06-25 Thread Private Private
Hi,

I am looking for a python library which will allow me to do a simple
web development. I need to use
some forms (but nice looking :-) ), creating images based on input
from those forms, etc. I have read a bit about Django and TurboGears
but I am afraid that this is too big for my requirements (am I
wrong ?).

Can you suggest anything ?
-- 
http://mail.python.org/mailman/listinfo/python-list