This article will let you get started with Django2 using Python3. It will make you familiar with the concept of virtual environment. Django is the web development framework for Python.
Django2 is only supported by python3, Django-1.11.x was the last version of Django supported by python2. To use django2 you need it to use using python3.
I strongly recommend using virtual environment for all django development.
You can follow this process:
$sudo apt-get install python3-pip
For Mac User
If Homebrew is not installed, then first install it to use
$/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now Install pip3 and python3
$brew install python3
This will install python3 as well as pip3.
Install Virtual Environment for Python3
$sudo pip3 install virtualenv
Create a project directory
Create a new virtual environment and activate it
In this environment
pip by default is
python by default is
After environment is activated, terminal will be preceeded with
(.venv)$ or your virtual environment name.
Now Install Django
(.venv)$pip install django
Check Django Version
Create project and start
(.venv)$django-admin startproject my_project
(.venv)$python manage.py runserver
Stop the server
To stop the development servert just hit
To deactivate the environment.
And again terminal will be like.
Like this post
Share this post on
About the author
- Career over Relationships. Family above everything else.
- Passionate Geek with love for Computer Science, Artificial Intelligence.
- Avid interest in Economics, Sports and Adventures.
- Curious to know outside the boundary limits, coz what I know is very little and what I don’t know is huge.
Join the discussion