Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96968

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

Path csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'preference': 0.05; 'cc:addr:python-list': 0.09; '22,': 0.09; 'django,': 0.09; 'url:github': 0.09; 'files.': 0.13; 'subject:python': 0.14; '.py': 0.16; 'cheap.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'logical.': 0.16; 'redirects': 0.16; 'subject:Problem': 0.16; 'subject:run': 0.16; 'wsgi': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(the': 0.22; 'sep': 0.22; 'am,': 0.23; 'code,': 0.23; 'defined': 0.23; 'bit': 0.23; 'split': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; '(my': 0.29; 'boundary': 0.29; 'probably': 0.31; 'though,': 0.32; 'utility': 0.33; 'tue,': 0.34; 'that,': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'too': 0.36; 'should': 0.36; 'lines': 0.36; 'framework': 0.36; 'urls': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'things': 0.38; 'thank': 0.38; 'files': 0.38; 'enough': 0.39; 'rather': 0.39; 'easy': 0.60; "you'll": 0.61; 'personal': 0.63; 'here:': 0.63; 'burden': 0.66; 'here': 0.66; 'arrangement.': 0.84; 'chrisa': 0.84; 'lighter': 0.84; 'loose': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=OSeg3wO10ysWHaRGzAxXGXuZd0PQzETCG4tPX4rJj6Y=; b=ibD9k1LSB5AsiRvhOzqpvHTFrQD2GYuIyNLepcbzrPq6OU6J5f73Xmjs0Hp/4Hc1+r 7q5tDKBjCBPqYAAQemetCUxnbJ0YVOIJxt4Kup9HcCqBsxj8r0XLRQdxfYXTC6z0O5qx WwCtTtehZYGYkvRTcBL3YlOj4DhqLOxrRoArLNuRz1R+9NwXPVvMBUzJQb4YHbnokarA xOcFfloOiIKFBYe0kgv6H+zItAQERTJQRMlMG3ZHSQCO+y8NeBAmwr9i2mHjJbrLPHrE 0uSBIT3rK/rowb/lmC8XuM99/vtLMfH+1RlyCJ8O8IUz75l1q7Tk2kzCC9pBK20K0b2c mkVw==
MIME-Version 1.0
X-Received by 10.50.67.43 with SMTP id k11mr14368126igt.92.1442875008445; Mon, 21 Sep 2015 15:36:48 -0700 (PDT)
In-Reply-To <3a7eff56-10de-4382-aad5-1ebb3bcf6c90@googlegroups.com>
References <44e870a7-9567-40ba-8a65-d6b52a8c5d25@googlegroups.com> <mtpmgq$sfa$1@reader1.panix.com> <e47b58e6-54a7-47d8-8d83-0490c12a3c44@googlegroups.com> <65b9162f-45e0-4ad8-82e9-e4813045c1cd@googlegroups.com> <mtppbd$uks$1@speranza.aioe.org> <3a7eff56-10de-4382-aad5-1ebb3bcf6c90@googlegroups.com>
Date Tue, 22 Sep 2015 08:36:48 +1000
Subject Re: Problem configuring apache to run python cgi on Ubuntu 14.04
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.47.1442875011.28679.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1442875011 news.xs4all.nl 23757 [2001:888:2000:d::a6]:57486
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:96968

Show key headers only | View raw


On Tue, Sep 22, 2015 at 7:36 AM,  <tropical.dude.net@gmail.com> wrote:
> Thank you very much. Can I write .py pages like in PHP or should I
> use a framework like Django, Web2py or TurboGears?

I recommend using WSGI and a framework that uses it (my personal
preference is Flask, but the above will also work). Here are a couple
of simple sites:

https://github.com/Rosuav/Flask1
https://github.com/Rosuav/MinstrelHall

You can see them in operation here:

http://rosuav.com/1/
http://minstrelhall.com/

Note how URLs are defined in the code, rather than by having a bunch
of loose files (the way a PHP web site works). This makes it a lot
easier to group things logically, and utility lines like redirects
become very cheap. The maintenance burden is far lighter with this
kind of one-file arrangement.

These sites are really tiny, though, so if you have something a bit
bigger, you'll probably want to split things into multiple files. Good
news! You can do that, too - it's easy enough to split on any boundary
you find logical.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 11:41 -0700
  Re: Problem configuring apache to run python cgi on Ubuntu 14.04 sohcahtoa82@gmail.com - 2015-09-21 12:19 -0700
    Re: Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 12:39 -0700
  Re: Problem configuring apache to run python cgi on Ubuntu 14.04 "Albert Visser" <albert.visser@gmail.com> - 2015-09-21 21:28 +0200
    Re: Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 12:44 -0700
  Re: Problem configuring apache to run python cgi on Ubuntu 14.04 John Gordon <gordon@panix.com> - 2015-09-21 19:41 +0000
    Re: Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 12:47 -0700
      Re: Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 12:51 -0700
        Re: Problem configuring apache to run python cgi on Ubuntu 14.04 alister <alister.nospam.ware@ntlworld.com> - 2015-09-21 20:29 +0000
          Re: Problem configuring apache to run python cgi on Ubuntu 14.04 tropical.dude.net@gmail.com - 2015-09-21 14:36 -0700
            Re: Problem configuring apache to run python cgi on Ubuntu 14.04 Chris Angelico <rosuav@gmail.com> - 2015-09-22 08:36 +1000

csiph-web