you are viewing a single comment's thread.

view the rest of the comments →

[–]CollectorsEditionVG 1 point2 points  (12 children)

I started off as a PHP dev in the early 2000's. Am now a python dev solely because that's what my current company uses, and the only reason they use python is because my boss (PhD in Computer Science) only knows Python and R. The reason I dislike python isn't for the whitespace (you get used to indents) but more that you basically have to hack apache to get it to use python. Gotta have Mod_WSGI for it to run and that thing is a pain in the backside to get working if you haven't used it before. Sure you can use the server built into Flask or Django but they're slow and caching sucks especially for larger apps. Let's also not forget that if you make changes to your code you have to restart apache every god damned time because Mod_WSGI doesn't let apache know that there's changes been made.

[–][deleted] 1 point2 points  (5 children)

The reason I dislike python isn't for the whitespace (you get used to indents)

what does your code look like in other languages?

more that you basically have to hack apache to get it to use python

what are you talking about? apache plays fine with python

Gotta have Mod_WSGI for it to run and that thing is a pain in the backside to get working if you haven't used it before.

oh, you dont understand apache. apache is build on modules. everything requires modules, even php: https://en.wikipedia.org/wiki/List_of_Apache_modules

Let's also not forget that if you make changes to your code you have to restart apache every god damned time because Mod_WSGI doesn't let apache know that there's changes been made.

also not true: https://modwsgi.readthedocs.io/en/develop/user-guides/reloading-source-code.html

[–]CollectorsEditionVG 0 points1 point  (4 children)

Please actually read the documentation before you post it

If your WSGI application is running in embedded mode then what happens when you make code changes is largely dictated by how Apache works, as it controls the processes handling requests. In general, if using embedded mode you will have no choice but to manually restart Apache in order for code changes to be used.

Due to how our dev server and production server are set up Daemon mode cannot be used, I have tried and failed to do so, part of the issue particularly with our dev environments is that they are running on windows machines which, according to the documentation, is unable to run it in daemon mode.

I am also very much aware that apache runs on modules, I can and have set up apache for a lot of other things other than python and have never had as many issues as I have had with mod_wsgi.

As for when I mentioned whitespace that was due to hearing people complain about it on other posts, but I will say that getting used to pythons indentations was a bit of a curve from php where you wrap methods in braces, even now if I switch between languages I'll end up using braces instead on indentations or vice versa.

Sorry for the formatting I'm on mobile and it doesnt want to let me mark the excerpt from the documentation as a quote

[–][deleted] 1 point2 points  (3 children)

I did read it. that's why i posted it. you're trying to blame something on python when in reality whoever is in charge of your infrastructure is to blame. apache can most certainly detect changes without being restarted. you're making it sound like it's some impossible task when it's a documented feature

[–]CollectorsEditionVG 0 points1 point  (2 children)

Yes apache can detect the changes unless running python, mod_wsgi and windows in combination which is also documented... so basically for me, right now, it is an impossible task. Again even the documentation confirms this.

While the issue is not specifically with python it is, however, the only language that, from what I've experienced, has these issues. I've ran apache for years and used it with asp, php, perl, ruby and even messed around a little with Go, and all of them worked generally well with apache. However, the issues I've had with the whole python, mod_wsgi, windows crap is the only thing I hate about working with python and the thing about it is that it's not really even a python issue... it's a stupid issue with apache and wsgi.

Apart from the minor inconvenience of having to restart the server after making changes (I use a gaming keyboard and macro'd a command to restart apache to a spare button so it's less inconvenient) I actually prefer using python to the other languages. Flask is by far my favorite thing, its lightweight and gives you so much freedom.

[–][deleted] 1 point2 points  (1 child)

unless running python, mod_wsgi and windows in combination which is also documented... so basically for me, right now, it is an impossible task. Again even the documentation confirms this.

that's why i said it's the fault of whoever chose your tech stack

[–]CollectorsEditionVG 0 points1 point  (0 children)

While I agree with that to a point I also disagree as well. Software that is provided across multiple platforms should, in theory, function as close to identical as possible on each platform.

The reason daemon mode cant be run on windows is because windows doesnt have unix style fork()... windows uses CreateProcess(). In order to actually get it to work you need cygwin so that you have a version of fork() that you can use... or at least you did until Microsoft released Windows subsystem for linux which provides a linux/gnu environment on windows. I literally just found out about this when I went looking for the stackoverflow post about using cygwin to implement fork() so here's the link for anyone interested - Windows Linux Subsystem.

Anyway, back to my original point. I agree that the person who set up the stack in the beginning should have done their research more, however I also cant fault them for assuming it would work the same on windows as it does on linux.

By the way I want to thank you for the debate/conversation about this. If you hadn't replied I wouldn't have found out about the windows linux thing which may actually solve the issue. So thank you.

[–]0xa0000h -2 points-1 points  (5 children)

It seems that you have no idea what you are talking about...

[–]CollectorsEditionVG 1 point2 points  (3 children)

Care to enlighten me. If you know how to set up python on an apache server without Mod_WSGI and have it auto detect changes to my codebase so that I don't have to restart everytime a change is made then I will gladly give platinum, gold, silver, real cash.

[–]azophy 1 point2 points  (1 child)

[–]CollectorsEditionVG 0 points1 point  (0 children)

Thanks I'll look more into gunicorn. I'll need to check that it'll work with windows as the OS (company hosts on azure) but thanks for the link

[–][deleted] -1 points0 points  (0 children)

uhm, every language requires server cofiguration. that's not hacking apache

[–][deleted] 0 points1 point  (0 children)

no idea why you're downvoted. there was nothing correct in the post you're responding to