Python framework questions

Discussion in 'Python' started by mp, Jul 5, 2006.

  1. mp

    mp Guest

    Hello, I have a couple general questions.

    First, how do most web frameworks serve html? I'm coding in python and
    I want to keep all my html seperate from my python stuff. I can serve
    these html files from a mysql database or just from the file system, do
    people use both these options? Are there other options?

    Second, is a cgi-bin directory really necessary? Are there security
    issues with configuring Apache to allow cgi-bin execution in other
    directories?

    Thanks
    MP
     
    mp, Jul 5, 2006
    #1
    1. Advertising

  2. mp

    Anand Guest

    mp wrote:

    > Hello, I have a couple general questions.
    >
    > First, how do most web frameworks serve html? I'm coding in python and
    > I want to keep all my html seperate from my python stuff. I can serve
    > these html files from a mysql database or just from the file system, do
    > people use both these options? Are there other options?


    most web frameworks generate html from some kind of templates.
    templates for very much like html but you can substitute some text
    dynamically at runtime. you may also be able to do conditionals and
    loops inside templates.

    if you want to get a feel of it, try web.py (http://webpy.org). web.py
    is a very simple and powerful web framework.

    > Second, is a cgi-bin directory really necessary? Are there security
    > issues with configuring Apache to allow cgi-bin execution in other
    > directories?


    i am not an apache expert.

    but to the best of my knowledge, there should not be any problems. it
    will be slower because for handling each request a new process has to
    be created.

    Anand
     
    Anand, Jul 6, 2006
    #2
    1. Advertising

  3. mp

    Guest

    mp wrote:
    > Hello, I have a couple general questions.
    >
    > First, how do most web frameworks serve html? I'm coding in python and
    > I want to keep all my html seperate from my python stuff. I can serve
    > these html files from a mysql database or just from the file system, do
    > people use both these options? Are there other options?


    The basic idea of templates is that you write something like:

    <h1>{{ HEADLINE }}</h1>
    <p>by {{ AUTHOR }}</p>
    <p>{{ STORY }}</p>

    and the web framework fills in the blanks. No need to store templates
    in a SQL database; they are just files.

    >
    > Second, is a cgi-bin directory really necessary? Are there security
    > issues with configuring Apache to allow cgi-bin execution in other
    > directories?


    Not only unnecessary but unadvisable. It's very 1995, quite out of
    fashion now. Read Tim Berners-Lee's article on "Cool URIs." URIs
    should just describe content. They are for the user's benefit, not
    yours. They are not a place to remind yourself where you stored code,
    or what language you write in (hello, .php, .asp, .pl, and .py), or how
    your web server gateways with your code.
     
    , Jul 6, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anatoly Volodko
    Replies:
    1
    Views:
    2,169
    Mattias Sjögren
    Aug 14, 2003
  2. Charles A. Lackman
    Replies:
    1
    Views:
    1,444
    smith
    Dec 8, 2004
  3. Mark
    Replies:
    4
    Views:
    1,748
    Juan T. Llibre
    Nov 17, 2005
  4. moi
    Replies:
    3
    Views:
    4,090
    quaiser_ali
    Sep 26, 2008
  5. Replies:
    2
    Views:
    9,368
    Darryl L. Pierce
    Sep 11, 2005
Loading...

Share This Page