FAQ
When I run the script on server,only HTML part gets executed.
But the python code appears as it is on the screen in the text format.
How to run the CGI script on web server using Python2.4.3?

Search Discussions

  • Bruno Desthuilliers at Jun 24, 2006 at 12:26 pm

    arvind wrote:
    When I run the script
    Which one ? And how ?
    on server,
    Which one ?
    only HTML part gets executed.
    HTML executed ???
    But the python code appears as it is on the screen in the text format.
    How to run the CGI script on web server using Python2.4.3?
    Depends on your web server. But there's very probably all the needed
    documention somewhere, and I'm pretty confident google will find it.


    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in 'onurb at xiludom.gro'.split('@')])"
  • Paul Boddie at Jun 24, 2006 at 1:43 pm

    arvind wrote:
    When I run the script on server,only HTML part gets executed.
    But the python code appears as it is on the screen in the text format.
    How to run the CGI script on web server using Python2.4.3?
    We don't have much specific information from you here, but taking a few
    guesses, it sounds like you have put a Python program in some directory
    that your Web server knows about, but when you visit the address in
    your browser that should let you use that program, you just see the
    program text, not the output of the program when it is run.

    What you need to do is to tell your Web server that the file is a
    "script". With Apache, for example, instead of using configuration
    directives like "Alias", you use "ScriptAlias" instead. Of course,
    Apache has lots of different ways to make files behave like scripts,
    and you may be using a completely different Web server, so a bit more
    information would be welcome.

    Still, one really simple method with Apache is to expose your program
    like this:

    ScriptAlias /myprogram "/home/me/programs/myprogram.py"

    Provided you set the permissions of myprogram.py to be readable and
    executable by the Web server user (if appropriate), and provided the
    Web server user can navigate to the /home/me/programs directory, you
    should at least get the program running. More configuration may be
    needed - why not let us know how far you get?

    Paul

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 24, '06 at 10:58a
activeJun 24, '06 at 1:43p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2023 Grokbase