Starting with python 3

software development

#1

I’m new to web development and have been following the instructions here to get a basic Django site going. I want to start directly with Python version 3, so I’ve also followed the steps in the “Installing a custom Python version” section of that page. Yet when time comes to check the version of Python being used, it shows I’m still using the default; i.e. python --version will report Python 2.7.3 and which python will report /usr/bin/python
How do I actually use python 3?

Now, I ran into something similar when following the Django tutorial locally. I’m on a Mac OS X system where the included python version is 2.7. After installing python 3, I had to call it with python3 in order to actually get version 3 behavior. My local solution was to setup an alias in my .bashrc, as described here. If I do something similar with my .bash* files on the server, won’t that only be in effect when I’m logged in via SSH? Will it actually use python 3 when time comes to serve the site?


#2

I’m running into the same issue lately. Did you ever solve it?


#3

Never did, sorry. Gave up after a while and switched to trying a ruby on rails site instead.


#4

I just started with Django last week and thought I would try it on my Dreamhost domain but got into similar issues last week trying to get Python 3 and the latest version of Django running.

After much Googling and Stackoverflowing, as well as following this post by a fellow Dreamhoster, which clearly demonstrates that it’s doable, and various articles in the Dreamhost Knowledge Base; I managed to get Python 3.5.2 and Django 1.10.1 running.

Because of the frustration that it was, some of which was the result of a lack of experience and others due to ambiguous/obscure instructions, I decided to go through it all again both as a learning experience and so that I could write a shell script to automate (most of) the process in case I need it again later or that others may need it.

If you are still interested you can find it in this Git repository: dreamdjango

Good luck! (:


#5

Python 3 is really good. Django too works best.