0

enter image description here

I am working to set up a django project on ec2 with an Ubuntu 14.4 LTS instance. I want to write my code using python 3 and django. I'm following http://www.nickpolet.com/blog/deploying-django-on-aws/1/ and have been able to get the django start page working. Previously I added django to both the default python 2.7 and the installed python 3.4.

I've created a virualenv and if I run the program after activating the virualenv I can use the python 3.4 interpreter. However, while testing I got the following error when I open the amazon ip address:

Exception Location:     /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response, line 111
Python Executable:  /usr/bin/python
Python Version:     2.7.6

As you can see the default python interpreter is in use. How do you force django to use the python 3 virtualenv?

5
  • stackoverflow.com/questions/26560636/… says that virtualenv is broke in ubuntu 14.04. You need to make sure to update it prior to creating your virtualenv. Also, when you installed django where you in a active state in your virtual env? Commented Mar 2, 2015 at 19:37
  • I used virtualenvwrapper, and I think it worked fine . My virtualenv was in the active state and I could see packages being installed in the python 3.4 directory Commented Mar 2, 2015 at 19:49
  • I appreciate you looking at this. However I Iooked your link above and there doesn't seem to be a connection to using a python 3 interpreter. just to reiterate i can get django working fine on python 2.7, but I want to use python 3 . Commented Mar 2, 2015 at 20:36
  • Understood and thank you, I will take another look at it Commented Mar 2, 2015 at 20:56
  • I have a follow up at stackoverflow.com/questions/28830917/python-uwsgi-setup-on-ec2 Commented Mar 3, 2015 at 11:42

1 Answer 1

1

I had a similar issue using apache and mod_wsgi and was unable to figure it out so I used this guide here and went with nginx and uwsgi and it worked awesome in like 30 minutes. Here is a quick tutorial on how to use uwsgi

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.