Is Python impractical for web development?

As a language, I like Python better than PHP. But, for web development, I am afraid that python may not be a practical choice.

Python requires special, non-standard, expensive, hosting. This is especially true if you want to use one of the popular python frameworks, and frameworks are probably the most practical way to develop web sites with python. In the likely case that a client already has a host, and that host does not work with python; it may be difficult to tell a client that he/she will have to change hosting, and pay much more.

If you need to hire developers, you will find that python developers are much more difficult to find.

If you want a job as a web developer, you will find that python is not a commonly demanded skill. Demand for python web developers certainly lags far behind demand for PHP, .Net, Java, or RoR, developers.

It seems like, if you are going to work on web-sites, you need to know PHP anyway. It’s like know html, and javascript.

Or is python such a great language, that it’s worth all the extra trouble? Or, am I wrong about everything?

Don’t give up on Python so fast. It is certainly gaining traction, and hosting isn’t all that much more expensive. Webfaction, to cite one, offers Python/Django for $9.50/mo (less if you pay in advance.)

If you plan to find a job in an area that isn’t a technological hot spot or maintain pre-existing sites, then you won’t escape from the triad PHP, Java, and C#, with the occasional RoR if you are lucky. But if you are creating your projects from scratch, Python is a great option.

It depends what you class as expensive hosting, many hosts now automatically include both ruby on rails and django (python) scripting as part of the package.

I am currently with mediaTemple and they offer RoR and Django containers at $20 a month (on top of the existing $20 a month you pay for hosting)… but for that you are getting dedicated resources over the usual grid / cluster hosting so your apps are going to be more stable as a result rather than them running just as part of a shared service, it’s almost to the point of cloud hosting :slight_smile:

I can get PHP hosting for $10 a year.

http://www.dollar-hosting.net/

Sure but PHP is designed for something totally different to Python.

If you are doing general purpose server-side scripting, PHP is file.
If you are making web applications or extensive multi-function scripts, python may be better.

I like python, a lot. But I know where you’re coming from. My webhosts only allow python on the high end Dedicated Server plans. I use it mostly for prototyping and proof of concept stuff, but I think it’s worth knowing and keeping in your toolbox.

[B]Is Python impractical for web development?

[/B]By itself, compared to PHP it would be highly impractical.

On a higher lever, with a framework like Django, it’s extremley practical. I come from a PHP background and I can say I haven’t really looked back, but there are some drawbacks (some of which you mention)

  1. Hard for beginners

I’m self taught, and I’ve found the documentation and tutorials available for python are offen much more theoretical than practical, and to start with, it was hard for me to wrap my head around it. The people who write/work with python/django tend to discuss the language on such a high level that it’s not even remotely interesting to me.

  1. Code evolution

This is only applies to Django, about 90% of blog posts and articles I find about Django are outdated, because only since last year, there has been so many changes/upgrades to the the framework. For a beginner, it’s really hard knowing what to believe and learn, thankfully though, the official django documentation is mostly really good, and their IRC channel is very friendly too :slight_smile:

  1. Hosting

Like you mentioned, deploying a python/django website takes more trickery than just uploading a PHP file. You need more knowledge and time setting it up to run smoothly. As a result, finding web hosting that supports it, and knows how to run it well, is harder and maybe just a little bit more expensive to find. But those that DO host it, tend to be very good.

Having said all this, I’ve totoally falled in love with Python and Django, and once you get rolling, there’s nothing stopping you :slight_smile:

Cheers

Python is indeed very good for webdevelopment, nice language! I also was a Python fan before I saw Coldfusion going! The problems of the most Python web frameworks are:

  • You need to have some OOP knowledge.
  • Not easy to learn.

Coldfusion takes rid of this problems! It is possible to use OOP (CFC’s) but it’s not necessary.

You could set up a server yourself. It’s not that hard.

We’re currently doing web development with Python and Django and I wouldn’t go back to PHP :).

Hosting is indeed a but tricky. But there are shared hosts that support running Python with Fastcgi. And also VPS prices are going down and you can have a more than decent full root machine for $10 a month.

Free hosting through Google for your Python apps isn’t all that expensive (unless you get so many visitors that they actually do start charging you for it).

When I chose what I am going to use for a project Python vs. PHP it comes down to scale. If it is small, it is normally far faster to hack something together in PHP.

However if it is something larger, take for example the current site I am working on ~12000 lines of python. I could never maintain that by myself in PHP, in python I find it easy.

If which one you chose really comes down to who/what you are. Single programmer who knows both and your working on you own thing and it is going to be something non trivial Python I think is a better choice.

If your going to pay someone else to write something for you, Python may not be the correct choice because of the problem finding developers who can use it.

Also Python is only now really starting to gain traction, so all the tools to make it easier don’t exist yet.

@PhazeStone
That Python frameworks are OOP based is a good thing. It might be a hurdle for beginner programmers doing small sites, but if your doing something much larger it makes a lot more sense. The amount of code I chose to write as OO has been roughly linked to my experience as a programmer.

Perl has this same problem, as far as the hosting. Often, they may even say “yeah we have perl (or python)” and it turns out they have some very old version with no modules. Often you need root access to load your desired modules.

One solution is some package you can get loaded onto the server that can load all the other stuff for you. A bit more palatable for the GoDaddies out there. I’ve seen some for Perl and I would think there are packages for Python that do the same thing.

While it’s likely true you won’t find Python guys running around as much as PHP guys, I think in general you would get higher quality guys period if you use Python. The shear number of available PHP guys doesn’t mean much if they’re very low level. Compare instead the number of available Pythong guys to the number of PHP guys who can code to high standards, preferably also with knowledge of one of the other OO programming languages too. They may even up more.