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: 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> <65b9162f-45e0-4ad8-82e9-e4813045c1cd@googlegroups.com> <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 Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Tue, Sep 22, 2015 at 7:36 AM, 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