Heroku (was Re: Lies in education [was Re: The "loop and a half"])

Ben Bacarisse ben.usenet at bsb.me.uk
Thu Oct 12 19:14:11 EDT 2017


Chris Angelico <rosuav at gmail.com> writes:

> On Fri, Oct 13, 2017 at 1:09 AM, Ben Bacarisse <ben.usenet at bsb.me.uk> wrote:
>> Chris Angelico <rosuav at gmail.com> writes:
>>
>>> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans <tjol at tjol.eu> wrote:
>>>> On 2017-10-12 07:31, Chris Angelico wrote:
>>>>> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse <ben.usenet at bsb.me.uk> wrote:
>>>>>> Provided some early part of the URL is handled by PHP, the rest of the
>>>>>> URL path is provided to PHP in $_SERVER["PATH_INFO"].
>>>>>
>>>>> Is it possible to do that without having ".php" visible in the path?
>>>>
>>>> Just like with Python-based frameworks, this requires a few lines of web
>>>> server configuration.
>>>>
>>>> On Apache, you might use mod_wsgi to tell the server how to run the code
>>>> in one case, and a combination of mod_php and mod_rewrite in the other.
>>>> If you're using FastCGI with nginx or lighttpd, I believe the
>>>> configuration would look pretty similar in both cases.
>>>>
>>>> Then again, I don't do much web programming any more and generally stay
>>>> away from PHP, so I may be misremembering.
>>>
>>> Normally, with a Python-based framework, you don't need _any_ web
>>> server configuration. You simply define your URL routing within the
>>> Python code. The only thing the web server needs to know is where to
>>> find the web app, and that's sufficiently standard that it can be done
>>> off-the-shelf; for instance, you push your code to Heroku, and they
>>> set everything up to pass requests to your app. Not possible with PHP,
>>> since you need *custom* web server config to manage your rewrite
>>> rules.
>>
>> That's at odds with what I've read online which admittedly may be all
>> junk.  I wanted to try Flask so I installed the Ubuntu packages but then
>> got stuck on a huge document that suggested I needed to install things
>> called Nginx and Gunicorn.  You've now mentioned another: Heroku.  I'm
>> sure the complex instructions I found are not really required -- it was
>> probably just the usual "this is what I did so this is how it's done"
>> document, but I'm having trouble finding the simpler way to do it.
>>
>> Since no web server configuration is needed (I have a working Apache
>> installation that mirrors, as closely as possible, what my hosting
>> provider uses) it should be relatively easy.  Can you tell me, or can
>> you point me to a resource that tells me, where to put the app?  I don't
>> yet know what "push your code to Heroku" means.
>
> I abbreviated that down to nothing, but since you ask, here's a really
> REALLY simple run-down of how to use Heroku:

I think I see what you mean now.  You meant no configuration is needed
because you use (or buy?) a cloud service that's all set up for it
already?

>From this and other posts I think the position is that I do need to do
some server configuration (and essentially install a proxy server) to
run Python web applications on my typical Apache set-up.  And I would
then have to shop around for suitable hosting that is already set up for
running them.

<snip instructions>

Thanks.  That's not quite what I was after but it's good to know how to
do that should I want to that later.

-- 
Ben.



More information about the Python-list mailing list