program organization question for web development with python

MRAB python at mrabarnett.plus.com
Thu Sep 16 20:01:58 CEST 2010


On 16/09/2010 18:19, Hans wrote:
> On Sep 15, 5:33 pm, James Mills<prolo... at shortcircuit.net.au>  wrote:
>> On Thu, Sep 16, 2010 at 10:14 AM, Hans<hans... at gmail.com>  wrote:
>>> I'm new to this area. Please allow me to ask some (maybe stupid)
>>> questions.
>>
>> Without reading the rest of your post too much. Designs are up to you,
>> I can't comment.
>>
>> I can only share in a fairly common view, and that is, we'd encourage
>> you to use a web framework
>> as opposed to plain old CGI.
>>
>> cheers
>> james
>>
>> --
>> -- James Mills
>> --
>> -- "Problems are solved by method"
>
> Hi James,
>
> Thanks for response.
> Maybe I did not make my question clear. I never tried python web
> programing before, so I want to start from CGI.
>
> I read something about web framework like django, but seems it's a
> little bit complicated. my task is actually very simple: get search
> string from input, and then search database, print search result. I
> thought CGI should be good enough to do this.
>
> I don't have any idea about how to organize those cgi codes, so what
> I'm asking is:
>
> 1. do I have to have each single file for each hyper-link? Can I put
> them together? how?
> 2. how can I pass a db_cursor to another file? can I use db_cursor as
> a parameter?
>
I recently wrote a web-based program using CherryPy, which was very
straightforward. That might suit your needs.



More information about the Python-list mailing list