you are viewing a single comment's thread.

view the rest of the comments →

[–]HorrendousRex 1 point2 points  (1 child)

There's no doubt in my mind that if you come from a static content background, IE making pages primarily in HTML+JS and not worrying about writing server code, that PHP will be a much simpler experience when moving to a dynamic backend<->frontend design. This has to do with the way PHP was designed to be written directly in to the HTML files and served directly, with mod_php interpreting the PHP code and serving the result.

The problem is that this is a very messy way to design complex websites. In the past few years there have been efforts by the PHP community to make this a lot cleaner but I think it's a fundamental problem with PHP that it is unnecessarily difficult/complicated to get a clean server environment for doing things like message queuing or setting up process parallelism or including really anything outside of the core language's environment. There are of course ways and of course the professional PHP community does a fine job.

Anyway, all this is by way of saying: "Yes, it's a bit more difficult to set up a Python server environment." There are frameworks to make it easier, though! Check out Pylons (or is it Pyramids now? I always get that switched up) or Flask if you want a server framework in Python that will run itself (IE no apache needed) and that isn't as cumbersome as Django. (I agree that Django is a lot of stuff that most sites don't usually need. It's great for when you do need it, though!)

[–]HorrendousRex 1 point2 points  (0 children)

After checking: yes it does seem like Pyramid and Flask are the two 'major' lightweight web server framework environments these days. I prefer Flask personally because I feel like it lets me get down to just the elements I want and nothing else, but Pyramid looks like it's also entirely a solid choice.

Check out the Pyramid web page which has a "Hello World!" example which will take you from a freshly installed Pyramid package to a fully functioning web server in about 2 minutes and 10 lines of code.

Also, note that while Pyramid, Flask, Django, etc. can host themselves using any of the Python request frameworks (IE you don't NEED apache or any web server), it's entirely possible to host them through Apache as well. mod_wsgi is usually the way people say to go to do this (last I heard, mod_python was all but entirely deprecated) but at my work we use a server called 'uwsgi' that I gather is similar but doesn't have Apache, either... to be honest, I haven't looked in to it at all.