Reputation: 321
I run the django on my ubuntu server. On the server, there are two different versions of python, which are python 2.x and 3.x. I use the request module of 3.x, but the server default uses the python of 2.x that occurs the error. How can that be solved? Thanks
I run the django with apache server, and here is the configuration.
Alias /static/ /python_web/person-blog/mysite/blog/static/
<Directory /python_web/person-blog/mysite/blog/static>
Require all granted
</Directory>
WSGIScriptAlias / /python_web/person-blog/mysite/mysite/wsgi.py
WSGIDaemonProcess xxx.com python-path=/python_web/person-blog/mysite:/python_web/env/lib/python3.4/site-packages
WSGIProcessGroup xxx.com
<Directory /python_web/person-blog/mysite/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Upvotes: 2
Views: 1333
Reputation: 385
You will point your server to the correct python interpreter. How that is done will depend on the server software you are using. This tutorial shows the apache configuration, close to the bottom of the page. Note the "python-path" being designated.
If you're running a server other than apache, then the answer will be similar. Just do a search for the server software you're using and "python interpreter" and you should be able to find your answer.
Upvotes: 1