IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Vous êtes nouveau sur Developpez.com ? Créez votre compte ou connectez-vous afin de pouvoir participer !

Vous devez avoir un compte Developpez.com et être connecté pour pouvoir participer aux discussions.

Vous n'avez pas encore de compte Developpez.com ? Créez-en un en quelques instants, c'est entièrement gratuit !

Si vous disposez déjà d'un compte et qu'il est bien activé, connectez-vous à l'aide du formulaire ci-dessous.

Identifiez-vous
Identifiant
Mot de passe
Mot de passe oublié ?
Créer un compte

L'inscription est gratuite et ne vous prendra que quelques instants !

Je m'inscris !

Le projet mod_python est "officiellement mort"
Le module Apache pour programmer des applications Web en Python est abandonné

Le , par Katleen Erna

21PARTAGES

2  1 
Le projet mod_python est "officiellement mort", le module Apache aidant à la programmation d'applications Web en Python n'est plus

Le projet mod_python consistait en un module Apache permettant d'intégrer un interpréteur Python, et de programmer des applications Web en Python.

C'était l'équivalent de mod_php ou mod_perl (qui intègrent respectivement un interpréteur PHP et Perl dans le serveur Apache).

Beaucoup d'applications et de frameworks Web écrits en Python supportent mod_python.

Malheureusement, ce projet vient d'être déclaré "officiellement mort" par son responsable (un développeur et consultant indépendant, australien). Lors de la dernière assemblée de la Fondation Apache (le 16 Juin 2010), il a été décidé à l'unanimité de cesser le projet Quetzalcoatl.

Comme ce dernier était en quelque sorte le dossier parent de mod_python, il en a signé l'arrêt de mort ; puisque son abandon signifie l'abandon de ses composants, dont mod_python.

Graham Dumpleton explique plus en détail sur son blog, dans un billet daté du 27 Mai, les raisons de cet échec (majoritairement : l'inactivité). Mais aussi, plus globalement, l'historique et le futur de Python. Enfin, il prodigue des conseils pour cesser l'utilisation de mod_python ; en présentant des alternatives.

Voici l'intégralité de son message :

The mod_python project last had a release February 2007. There has more or less been no developer activity since. Under the rules of the Apache Software Foundation if a project becomes inactive then it can be moved into what is called the Apache Attic. Come the next meeting of the ASF board a proposed resolution will be put up to dissolve the Quetzalcoatl project management committee and projects which it overseas, namely mod_python. Thus, in some respect one can say that mod_python will be officially dead.

What will this really mean. Well, no more development on mod_python, but then that isn't happening now. Linux distributions will likely still carry the package, but they will need to apply any changes themselves to ensure that it continues to work for newer versions of Apache. This actually is already being done as a bug in mod_python was exposed by some changes to the Apache runtime library and since no mod_python release has been made since then, only option was for distributions to patch it themselves.

I suspect though that this patching by distributions will only extend to Apache 2.2.X as Apache 2.4 changes the internal APIs enough that getting mod_python to compile will need more significant changes than a minor patch. You also will never see a version of mod_python for Python 3.X as that is going to require a radical rewrite.

For platforms like MacOS X where the last release of mod_python doesn't build properly, the only option will be to checkout mod_python source code from the subversion repository as that incorporates a fix for those issues, although it has since been shown to not be a complete fix and so you may still have some problems. In other words, the subversion repository will still exist, but it will be made read only and the location may potentially move.

What options exist if you want to move away from mod_python?

If you are only using mod_python as a means of hosting within Apache a distinct Python web framework or application and it supports the WSGI interface, then the obvious candidate is to move to mod_wsgi instead.

If you are using mod_python to implement custom access, authentication or authorization handlers, then you may also be able to get away with using mod_wsgi. You may have to make compromises though as mod_wsgi doesn't currently allow you to write full blown Apache style handlers and instead only implements the Apache authentication and authorization provider interfaces. This actually makes it easier to do most things, but you loose the ability to do some more complicated stuff which depends on using different error status values or custom error pages. You can partly get away with using ErrorDocument directive to return custom error pages, but not always.

Although proper support for Apache style handlers could be added to mod_wsgi, and a lot of work has been done in that direction already through the implementation of SWIG bindings for Apache, whether the remaining work to allow the actual hooking of handlers into mod_wsgi will be done will really depend on interest in it. Up till now, there hasn't been sufficient interest to justify doing the final bit of work and there has actually been some resistance put up to the idea of extending mod_wsgi too far beyond the core goal of providing WSGI hosting.

If you are not using the basic handler mechanisms of mod_python and are instead using the CGI handler, the publisher handler or PSP handler, then there aren't really any options at this point except for rewriting your application on top of a WSGI framework. If you have to do such a rewrite, but like the low level that one works at when using mod_python, then would strongly recommend you perhaps look at Werkzeug andFlask.

If you are using mod_python input or output filters there simply isn't any replacement. Frankly though I always thought that writing input or output filters in mod_python was a really bad idea. Yeah it may work, but it wouldn't exactly be efficient. You would be much better writing a proper Apache module in C to do what is required, certainly if performance is an issue.

Finally, the ability to use Python code with Apache server side include mechanism also has no real equivalent. But then, not sure anyone ever actually used that feature anyway. Something similar could possibly be implemented in mod_wsgi but not sure there would really be a point. If you are only using ability to include Python code, you would be much better off using a proper templating system that works with a WSGI framework.

So, the writing is on the wall so to speak and if you are using mod_python, you really should be starting to plan how to move away from it as eventually it will likely not be an option you can use if you want to keep up to date with Apache and/or Python.

Could it yet be saved by a white knight. Well, yes it could as the Apache Attic does allow projects to be resurrected or forked with it then being maintained outside of the ASF. If someone does do the latter though, you would need to be mindful of the name as the ASF in some respects has rights over the mod_python name. As such, you would likely need to rename the project when you take it over.

If you fork mod_python, you would also want to think about capturing all the details of the significant number of still open bug reports for mod_python in its issue tracker, as am not sure what will happen to that and whether it will be made read only or whether it will be completely closed down.

Anyway, will be interesting times ahead. I should point out though that according to Google trends(currently borked), searches on WSGI finally overtook those for mod_python recently. Searches for mod_wsgi haven't yet, but not far off occuring. It is also the common belief that WSGI is the way to go for Python web applications now, so perhaps it is simply time to just move on from mod_python. If we could only just get newbies, who even now keep using mod_python even though better options exist, to understand this, then maybe it can finally be left to die in peace.
Source : L'annonce de l'abandon de mod_python par Graham Dumpleton

Une erreur dans cette actualité ? Signalez-nous-la !

Avatar de TSalm
Membre habitué https://www.developpez.com
Le 26/04/2011 à 11:07
Une nuance est placée sur le site officiel :
Currently mod_python is not under active development. This does not mean that it is "dead" as some people have claimed. It smiply means that the code and the project are mature enough when very little is required to maintain it.
2  1 
Avatar de TSalm
Membre habitué https://www.developpez.com
Le 26/04/2011 à 22:33
Ce n'est pas le langage qui est remis en cause, mais mod_python, qui est une extension à apache.
Je l'ai un peu expérimenté. C'est un plutôt intéressant.
Il y a 3 modes (handlers) différents :
- CGI, qui permet d'appeler directement un script Python avec son chemin
- Publisher, propose une architecture différente et pas inintéressante puisque qu'il dirige vers une fonction spécifique d'un script centralisé(http://monadresse.com/monscript.py/mafonction). C'est aussi beaucoup plus rapide que le handler CGI.
- PSP, où tout est centralisé dans la fonction "handler" d'un script. C'est à script de parser le reste de la requête et de gérer ce qu'il retourne. Mega rapide de traitement, il permet des choses très spéciales puisqu'on peut placer ce qu'on veut dans la requête. Mais c'est une vue de plus bas niveau donc un peu plus complexe à gérer...

Pour ceux qui veulent se faire une idée, la doc officielle est à lire :
http://www.modpython.org/live/current/doc-html/

A+
-TSalm
0  1 
Avatar de sybil
Inactif https://www.developpez.com
Le 28/04/2011 à 12:39
Tres dommage que ce projet ne soit pas actif a l'heure actuelle.
0  1 
Avatar de marcleb1
Nouveau membre du Club https://www.developpez.com
Le 01/05/2011 à 23:22
Moi qui pensais sérieusement me mettre au développement web en Python, voilà qui me coupe l'herbe sous le pied...
0  1 
Avatar de gorgonite
Rédacteur/Modérateur https://www.developpez.com
Le 02/05/2011 à 8:22
bof... regardes mod_wsgi sous Apache par exemple
0  1 
Avatar de sybil
Inactif https://www.developpez.com
Le 26/04/2011 à 22:15
Je sais pas, j'ai jamais acrocher avec Python et sa syntaxe mais a vrai dire ça serait bien on aurait autre chose que du php partout.
1  4