Python simple web development

P

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 ?
 
S

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.
 
P

Private Private

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
 
C

Chris Withers

Private said:
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
 
G

Gabriel Genellina

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.
 
D

Daniel Fetchinson

What I've read about Django, Turbogears is that they are powerful
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
 
T

Thomas Allen

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
 
P

Petr Messner

What about Werkzeug? I like its simplicity (well, basically everything
I need are WSGI request/response objects :) + some templating
library).

Petr
 
L

laplacian42

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.
 
K

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top