Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96068
| References | <3877a9ae-edbd-4d36-925a-5cb3789bd1bd@googlegroups.com> <mailman.170.1441541749.8327.python-list@python.org> <31ec836b-4cb0-4079-8c12-f6b66a5cd143@googlegroups.com> <mailman.176.1441543545.8327.python-list@python.org> <361cf277-b469-4873-891d-0153498794ef@googlegroups.com> |
|---|---|
| Date | 2015-09-06 23:23 +1000 |
| Subject | Re: Can anyone help me run python scripts with http.server? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.177.1441545797.8327.python-list@python.org> (permalink) |
On Sun, Sep 6, 2015 at 11:07 PM, <tropical.dude.net@gmail.com> wrote:
> I will definitely look into python web frameworks in the future, they seem
> complicated to me compared to php for example. I am looking for the simplest
> way to test my python scripts till I understand better how it works and when
> I can configure my own web server to run the framework because I want develop my
> stuff offline.
Look into Flask. You can do something really simple:
https://github.com/Rosuav/MinstrelHall
All the code is in one file for simplicity, though for a larger
project, you can break it up as required. (Compared to PHP, where
you're _forced_ to have exactly one file per entry-point, this is a
nice flexibility.) Then I just have one line in my Apache config file
that looks something like this:
WSGIScriptAlias / /path/to/scripts/MinstrelHall/mh.wsgi
and Apache does all the rest. There's some cruft in that code to get
around a few oddities, but for the most part, writing a page is as
simple as writing a function, decorated to manage routing, that
returns render_template("somefile.html"). It's pretty easy.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 04:50 -0700
Re: Can anyone help me run python scripts with http.server? Laura Creighton <lac@openend.se> - 2015-09-06 14:15 +0200
Re: Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 05:35 -0700
Re: Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 05:38 -0700
Re: Can anyone help me run python scripts with http.server? Laura Creighton <lac@openend.se> - 2015-09-06 14:45 +0200
Re: Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 06:07 -0700
Re: Can anyone help me run python scripts with http.server? Chris Angelico <rosuav@gmail.com> - 2015-09-06 23:23 +1000
Re: Can anyone help me run python scripts with http.server? Denis McMahon <denismfmcmahon@gmail.com> - 2015-09-06 20:04 +0000
Re: Can anyone help me run python scripts with http.server? Chris Angelico <rosuav@gmail.com> - 2015-09-07 12:48 +1000
Re: Can anyone help me run python scripts with http.server? Laura Creighton <lac@openend.se> - 2015-09-06 17:03 +0200
Re: Can anyone help me run python scripts with http.server? Chris Angelico <rosuav@gmail.com> - 2015-09-07 01:13 +1000
Re: Can anyone help me run python scripts with http.server? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-06 13:11 -0400
Re: Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 05:42 -0700
Re: Can anyone help me run python scripts with http.server? Chris Warrick <kwpolska@gmail.com> - 2015-09-06 14:16 +0200
Re: Can anyone help me run python scripts with http.server? Laura Creighton <lac@openend.se> - 2015-09-06 14:28 +0200
Re: Can anyone help me run python scripts with http.server? Peter Otten <__peter__@web.de> - 2015-09-06 14:32 +0200
Re: Can anyone help me run python scripts with http.server? Peter Otten <__peter__@web.de> - 2015-09-06 14:43 +0200
Re: Can anyone help me run python scripts with http.server? tropical.dude.net@gmail.com - 2015-09-06 05:47 -0700
csiph-web