Non c'est un django tout fait normal que j'ai récupéré depuis www.djangoproject.com
A toutes fin utiles, je copie / colle ci-dessous les étapes que j'ai suivies (dans l'ordre) depuis la réinstall de mon serveur : Comme tu peux voir, j'ai installé Python 2.7 et ensuite, j'ai installé Django en appelant explicitement Python 2.7 : sudo python2.7 setup.py install car quand je tape "python" dans le shell, ca me lance python 2.4 Je ne sais pas si cela a une incidence? Merci d'avance ============== INSTALLER setuptools ======== wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz tar xzvf setuptools-0.6c11.tar.gz cd setuptools-0.6c11 python setup.py install ============================================= ============== INSTALLER virtualenv ========== easy_install virtualenv virtualenv my_websites source my_websites/bin/activate ============================================== ============== INSTALLER mysql python ======== easy_install mysql-python ============================================== ============== INSTALLER pil ======== easy_install pil ===================================== ============ INSTALLER python 2.7 === wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar xzvf Python-2.7.3.tgz cd Python-2.7.3 ./configure make make install ====================================== ========= INSTALLER django ===== wget https://www.djangoproject.com/download/1.4/tarball tar xzvf Django-1.4.tar.gz cd Django-1.4 sudo python2.7 setup.py install ================================ == INSTALLER mod_wsgi POUR APACHE =========== wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz tar xzvf mod_wsgi-3.3.tar.gz cd mod_wsgi-3.3 ./configure --with-apxs=/usr/local/apache/bin/apxs make make install ============================================= vi /usr/local/apache/conf/httpd.conf --------------- Dans la section LoadModule du Httpd.conf ajouter ------ LoadModule wsgi_module modules/mod_wsgi.so ----------------------------------------------------------------------- --------------- Dans httpd.conf ajouter à la fin : ---------- WSGIScriptAlias /mon_site /home/mon_site/wsgi/wsgi.py <Directory /home/mon_site/> Order deny,allow Allow from all </Directory> -------------------------------------------------------------- -------------- Créer un fichier wsgi.py pour test -------- def application(environ, start_response): status = '200 OK' output = 'Hello Django' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] -------------------------------------------------------------- <redémarrer Apache> Se rendre à l'adresse http://XXXXX.ovh.net/mon_site et vérifier que mod_wsgi et apache tournent (la page affiche Hello Django) -------------- Remplacer le contenu du fichier wsgi de test par -------- import site import sys import os sys.path.append('/usr/local/lib/python2.7/site-packages') DIRS = ['/home/my_websites'] for directory in DIRS: site.addsitedir(directory) sys.path.insert(0, directory) root = os.path.join(os.path.dirname(__file__)) sys.path.insert(0, root) os.environ['DJANGO_SETTINGS_MODULE']='mon_site.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() -------------------------------------------------------------- _______________________________________________ django mailing list [email protected] http://lists.afpy.org/mailman/listinfo/django
