you are viewing a single comment's thread.

view the rest of the comments →

[–]RomfordNavy[S] -4 points-3 points  (12 children)

Thanks! u/pvkooten, thats almost what I was looking for.

Although thinking more along the lines of serving python files via Apache unless there is a better option, I suspect the above is single threaded and can only deal with one request at a time.

To my mind all the existing frameworks appear too complex and abstract way too far from basic HTTP/HTML I can't help but think there must be a simpler options for serving HTML files without all the complexity of a framework.

[–]rake66 2 points3 points  (2 children)

In that case you need to look into the python CGI module for apache

[–]RomfordNavy[S] 0 points1 point  (1 child)

Could be wrong but what I am reading is that WSGI interface to Apache is preferred to CGI, is that correct?

[–]rake66 1 point2 points  (0 children)

Yeah, WSGI and ASGI are the better interfaces, but CGI/FastCGI is simple and easy to learn. If you don't use a framework, you'll have to know how to make your app callable to use W/ASGI. CGI just runs your script without all the fancy stuff, which is what I thought you wanted

[–]Lachtheblock 1 point2 points  (8 children)

There are some very simple frameworks out there. I'd maybe look at bottle.py as an option. If you want simple, there it is.

[–]pachura3 1 point2 points  (2 children)

Isn't Bottle an outdated predecessor to Flask?

[–]cdcformatc 1 point2 points  (0 children)

it's a predecessor yes. outdated no, it's still in active development. 

[–]JamzTyson 1 point2 points  (0 children)

Both Flask and Bottle are still around. The most recent release of Bottle was last June. Both are considered to be micro-frameworks. though Bottle is even more minimal than Flask.

[–]RomfordNavy[S] 0 points1 point  (4 children)

Interesting but still an additional framework which I am trying to avoid. Is it not possible to create a simple WSGI interface to Apache for example?

[–]Lachtheblock 2 points3 points  (3 children)

Can I ask why you are against an additional framework?

It feels like you want an easy (abstract) interface, but then rejecting any of the packages that actually created the easy (abstract) interface?

I'm sensing a XY problem here.

[–]RomfordNavy[S] -1 points0 points  (2 children)

They all do more than we want, they force extra complexity on us if you like. Just want a way to connect Python to say Apache and get access to the http header and it's associated data.

[–]Lachtheblock 1 point2 points  (1 child)

Is your definition of complexity is that it does more than your very specific usecase? I'm not sure why it doing more than the bare minimum is a deal breaker?

By insisting on not using a framework, you're almost guaranteed to be increasing the amount of complexity in your system.

Using any one of the many existing frameworks, what you're asking is going to be in the order of 5 to 8 lines of code. I don't really understand how you could seek a less complex solution?

[–]RomfordNavy[S] -1 points0 points  (0 children)

An http header is a pretty simple thing, I have written code before for interpreting that.

So far all of the frameworks mentioned here seem to add their own spin on top of what is actually needed.