#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11

    intranet python app as server instead of Apache?


    Hi all,

    I'm trying my hand at a python database script. This is for a standalone computer with python mysql and apache. Do I really need apache for localhost at all? Seems like overkill. I'm thinking of using python to serve the data to the browser based on python script cgi requests to/from the database.

    Sounds like a nice little project. If you could mention your fav modules to accomplish this task please reply. Any good websites with tutorials that you like would help a lot too.

    Would SimpleCGIServer be enough or am I about to choke on a particularly large piece of steak?? (pythons can swallow anything so I hope it can here too )

    Thanks for any tips
    sf2k
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11

    found link for simplehttpserver


    found it!

    it's a link to bruce eckel's explanation of using python to handle a localhost website for csv files. it enters records into a csv file and is setup without sessions, so saves to file each time. Really good working example of simpleHTTPServer in action.

    Even if you don't plan on using csv at all, I think it's still a good idea to read if you ever need to use simpleHTTPServer.

    http://www.artima.com/forums/flat.js...4&thread=26147

    download flatfiler.py

    Thanks to this, I'll only need python and mysql to run my app, which is what i was looking for
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    just wanted to point out that apache can run pretty clean with removing a few modules, I also recommend using mod_python instead of python though cgi. A lot more secure and the speed increase is insain.
  6. #4
  7. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    I've had a quick play with Twisted, which is very fast & very cool. BaseHTTPServer is another one to look at.

    However, my preference would be for mod_python on apache too, but it depends on your needs.

    --Simon

IMN logo majestic logo threadwatch logo seochat tools logo