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

References (1 earlier) <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 2015-09-22 08:36 +1000
Subject Re: Problem configuring apache to run python cgi on Ubuntu 14.04
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.47.1442875011.28679.python-list@python.org> (permalink)

Show all headers | 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