virtualenv for python3
Simple steps to setup virtualenv for Python3
To setup virtualenv for python3 for Django projects, create and cd into the desired folder for the Django project.
Create a folder for virtualenv, eg mkdir venv
[sourcecode language="plain"]$ cd venv // The created folder for virtualenv [/sourcecode]
Then run these commands worked for me in this order:
[sourcecode language="plain"]$ virtualenv -p python3 . // setup virtualenv with python3 fin current directory [/sourcecode]
[sourcecode language="plain"]$ source bin/activate // ativate virtualenv [/sourcecode]
At this point, checking python version will give python3
Install Django:
[sourcecode language="plain"]$ pip install django [/sourcecode]
To see all installations run :
[sourcecode language="plain"]$ pip freeze //Django should be included in the list of installations [/sourcecode]
Start Django project
[sourcecode language="plain"]$ django-admin startproject --projectname [/sourcecode]
cd into created project and run:
[sourcecode language="plain"]$ python manage.py runserver [/sourcecode]