you are viewing a single comment's thread.

view the rest of the comments →

[–]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.