请问一下如何在部署django的时候,指定python的运行版本?阿里云默认的是使用python2.7的版本,但是我开发用的python3,但是我部署在apache上,老是运行2.7(因为是默认的),很多包和库都不兼容 很麻烦.
所以特此来求教一下!
Installez d'abord python3 puis configurez le lien logiciel
ln -s /usr/bin/python3 /usr/bin/python
Compilez et installez Python 3 par vous-même, puis utilisez-le pour installer Django.
Enfin, spécifiez-le simplement dans le fichier de configuration Apache
WSGIScriptAlias / /my/app/path/wsgi.py WSGIPythonPath /my/app:/path/to/the/virtual/env/lib/python3.3/site-packages
PS : la prise en charge de Python 3 nécessite Django 1.6 et mod_wsgi 3.4 lien : http://stackoverflow.com/questions/5930585/how-to-use-python-3-and-django-with-apache/
python3 yourCmdOu vous pouvez envisager virtualenv
Il est recommandé d'utiliser virtualenv, vous pouvez spécifier la version de python lors de la création
Installez d'abord python3
puis configurez le lien logiciel
Compilez et installez Python 3 par vous-même, puis utilisez-le pour installer Django.
Enfin, spécifiez-le simplement dans le fichier de configuration Apache
PS : la prise en charge de Python 3 nécessite Django 1.6 et mod_wsgi 3.4
lien : http://stackoverflow.com/questions/5930585/how-to-use-python-3-and-django-with-apache/
python3 yourCmd
Ou vous pouvez envisager virtualenv
Il est recommandé d'utiliser virtualenv, vous pouvez spécifier la version de python lors de la création