web Develop question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gerkarcher@gmail.com

    #1

    web Develop question

    hi guys ,

    I' m new to python ...and I would like to ask you , wich is the best
    template for developing dinamic generated pages using python ?

    I would like to use something easy to install and develop like php <?
    ? > tags and with a lots of features .

    thanks in advance and sorry for this silly question .

    regards,

    richard

  • Luis M. González

    #2
    Re: web Develop question


    gerkarcher@gmai l.com wrote:[color=blue]
    > hi guys ,
    >
    > I' m new to python ...and I would like to ask you , wich is the best
    > template for developing dinamic generated pages using python ?
    >
    > I would like to use something easy to install and develop like php <?
    > ? > tags and with a lots of features .
    >
    > thanks in advance and sorry for this silly question .
    >
    > regards,
    >
    > richard[/color]

    I suppose you're asking about frameworks.
    There are many to choose from. There are two that are getting a lot of
    attention lately: Django and Turbogears, but it seems there are as many
    options as developers out there...
    If you're running your own server, you can choose anyone.
    The real problem is finding a shared hosting service with the option of
    your choice (at an affordable price).

    I am very comfortable with bare-bones mod_python. Mod_python is a
    module that embeds the python interpreter into Apache (a la php). It is
    not a framework (what's more, many frameworks rely on mod_python), but
    it gives you many facilities for web development.

    I find specially handy its publisher handle, which lets you match urls
    to pages.
    It can be complemented with a template system, like Cheetah (very good)
    or its own PSP (python server pages implementation) as a template
    system.
    It also gives you the best performance (as far as I know, please
    correct me if I'm wrong).

    Luis

    Comment

    • Fredrik Lundh

      #3
      Re: web Develop question

      gerkarcher@gmai l.com wrote:
      [color=blue]
      > I' m new to python ...and I would like to ask you , wich is the best
      > template for developing dinamic generated pages using python ?
      >
      > I would like to use something easy to install and develop like php <?
      > ? > tags and with a lots of features .
      >
      > thanks in advance and sorry for this silly question .[/color]

      for a start, look under "templating engines" on this page:



      (hint: googling for stuff works pretty well, too ;-)

      </F>

      Comment

      • gerkarcher@gmail.com

        #4
        Re: web Develop question

        Dear Luis ,

        Thanks for your kindly answer , so you say that installing mod_python
        and a template like chetaah or dyango I can do like as I do with php
        and Apache ?

        < ?
        print........
        ?>


        Thanks ,
        regards
        Richard





        Luis M. González ha escrito:
        [color=blue]
        > gerkarcher@gmai l.com wrote:[color=green]
        > > hi guys ,
        > >
        > > I' m new to python ...and I would like to ask you , wich is the best
        > > template for developing dinamic generated pages using python ?
        > >
        > > I would like to use something easy to install and develop like php <?
        > > ? > tags and with a lots of features .
        > >
        > > thanks in advance and sorry for this silly question .
        > >
        > > regards,
        > >
        > > richard[/color]
        >
        > I suppose you're asking about frameworks.
        > There are many to choose from. There are two that are getting a lot of
        > attention lately: Django and Turbogears, but it seems there are as many
        > options as developers out there...
        > If you're running your own server, you can choose anyone.
        > The real problem is finding a shared hosting service with the option of
        > your choice (at an affordable price).
        >
        > I am very comfortable with bare-bones mod_python. Mod_python is a
        > module that embeds the python interpreter into Apache (a la php). It is
        > not a framework (what's more, many frameworks rely on mod_python), but
        > it gives you many facilities for web development.
        >
        > I find specially handy its publisher handle, which lets you match urls
        > to pages.
        > It can be complemented with a template system, like Cheetah (very good)
        > or its own PSP (python server pages implementation) as a template
        > system.
        > It also gives you the best performance (as far as I know, please
        > correct me if I'm wrong).
        >
        > Luis[/color]

        Comment

        • Luis M. González

          #5
          Re: web Develop question

          gerkarcher@gmai l.com wrote:[color=blue]
          > Dear Luis ,
          >
          > Thanks for your kindly answer , so you say that installing mod_python
          > and a template like chetaah or dyango I can do like as I do with php
          > and Apache ?[/color]

          Do not get confussed:
          Django is a complete web development framework, and "Cheetah" is just a
          template engine.

          You don't need any framework to use mod_python (although many
          frameworks use mod_python as a deployment option, as well as CGI or
          FastCGI, etc).
          Mod_python is just the module that lets you use python with Apache.

          However, it has some built-in capabilities for letting you build web
          sites.
          They are called "handlers". You can write your own handlers, or you can
          use the ones included within mod_python.

          The main two handlers are:
          1) PSP: this stands for Python Server Pages, and it is a way to parse
          scripts in a PHP-like way. For example, you enclose your python
          instructions between <% and %> tags, and your can mix them within html.
          However, it is not very polished and I would recomend it...

          2) Publisher: It lets you write scripts where you define functions,
          that correspond to different pages. For example, if you define a
          function "index" it will contain the code to display your main page.
          This way you can create a whole site with only one script.
          You can include html code within these functions, but it is recommended
          to use a template system combined with publisher, in order to separate
          presentation and logic.
          Cheetah is a very good templating engine.

          I suggest you start by reading mod_python's documentation, and then,
          when you are up and running with all your installation, you can check
          Cheetah...

          Hope it helps...

          Luis

          Comment

          • Luis M. González

            #6
            Re: web Develop question


            Just to give you an idea of what it is, you can check this article:
            http://www.onlamp.com/pub/a/python/2...ver_pages.html...

            This explains the whole thing much better than I did with my poor
            english...

            Luis

            Comment

            Working...