Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a production ready web application framework in Python?

I heard lots of good opinions about Python language. They say it's mature, expressive etc... I'm looking for production-ready enterprise application frameworks in Python. By "production ready" I mean :

  • supports objective-relational mapping with caching and declarative desciption (like JPA, Hibernate etc..)
  • controls oriented user interface support - no HTML templates but something like JSF (RichFaces, Icefaces) or GWT, Vaadin, ZK
  • component decomposition and dependency injection (like EJB or Spring)
  • unit and integration testing
  • good IDE support
  • clustering, modularity etc (like Terracota, OSGi etc..)
  • there are successful applications written in it by companies like IBM, Oracle etc (I mean real business applications not Twitter)
  • could have commercial support

Is it possible at all in Python world ? Or only choices are :

  • use Python and write everything from the bottom (too expensice)
  • stick to Java EE
  • buy .NET stack
like image 760
Piotr Gwiazda Avatar asked Apr 15 '10 07:04

Piotr Gwiazda


People also ask

Does Python have a web framework?

Python Web framework is a collection of packages or modules that allow developers to write Web applications or services. With it, developers don't need to handle low-level details like protocols, sockets or process/thread management.

Can you build a web application using Python?

Python can be used to build server-side web applications. While a web framework is not required to build web apps, it's rare that developers would not use existing open source libraries to speed up their progress in getting their application working. Python is not used in a web browser.

Is there a Python front end framework?

PyScript is a Python front-end framework that enables users to construct Python programs using an HTML interface in the browser.


2 Answers

Django seems like the obvious choice. It is by far the most stable and developed framework, used by several large corporations.

Because it is a Python framework, it can generally use any Python module, as well as the many modules that have been made for Django.

It should fulfill all of your needs, and is not terribly difficult to learn/deploy.

like image 145
Mantas Vidutis Avatar answered Oct 05 '22 09:10

Mantas Vidutis


For the context, I work at a large private bank in Switzerland, writing Enterprise applications on the J2EE stack.

There are plenty of "Production Ready" web frameworks in Python. And there are plenty of large Python-based websites out there.

That said, I think Python is a poor choice for an Enterprisy application. It can be used as a glue language, or a scripting language (our deployment scripts are Python). The showstopper for me is backward compatibility (Python 3.x isn't backward compatible with Python 2.x). The Python philosopy seems to be more to innovate and make the language better, smoother, and not necessarily to support programs written 10 years ago.

On the Web framework side, I love Django, but it is definitely much too young and it evolves too rapidly to be used in the enterprise. I don't have much experience with other Python-based frameworks.

If you want an enterprise-oriented framework, you'll have to stay with enterprise stacks (Java / .Net).

On the other hand, even in the Java world, there is a tendency to use frameworks that are less enterprisy. Think Spring vs EJB2 or EJB3 being much lighter weight than EJB2. Or think Flex (which is far from an enterprise framework in my view) being used more and more in the enterprise. So if your enterprise is openminded enough, ready to jump into the future, using Django, RoR or other modern Web 2.0, community driven, Open Source, next generation, active record based frameworks ... might not be that much of a stretch ...

And finally, to answer a few of your points directly :

  • support of ORM / caching / ... : yes, but most solutions are based on active record, which is fine for 90% of what you might want to do, but is definitly not as complete / complex as JPA / Hibernate
  • control-oriented UI : no, and you wont find a standard, so you wont find 3rd party components. The closest you might get is integration with jQuery or other JS UI frameworks
  • dependency injection : There is a port of Spring to Python, maintained by SpringSource. But DI is not in the Python philosophy. The same problem will be resolved with functions, default arguments and closures. And we might argue that the Pythonic solution is cleaner than the Java way ...
  • unit / integration tests : very good support, multiple test frameworks. Still, support is not as good as Java where we have tons of tools around testing.
  • good IDE support : there are technical limitations to the ammount of support you can provide to a dynamic language, but at least both Eclipse and Netbeans have great support for Python.
  • clustering / modularity : clustering will be resolved with a "share nothing infrastructure" and/or distributed caching. There are no solutions for modularity (in the OSGI sense) as far as I know. But I would challenge that very often OSGI is a solution for a problem we dont have in the enterprise ...
like image 25
Guillaume Avatar answered Oct 05 '22 09:10

Guillaume