Select Page

Today i am going to show how to setup or install Django environment on Ubuntu. I will be concentrating only on python 3 version. Django is web application framework written in python, It Uses MVT (Models, Views, Templates) Concept .

We will be installing django in an isolated environment but why? simple because we do not want django packages to mess with os python libraries, we will be using pip to install packages and virtualenv to create virtual environments.pip is a package management system used to install and manage software packages written in Python. Now open your terminal and follow this commands

Install python3 Pip

Install Virtualenv

Create new directory for your project

Create new Virtual Environment we will call it py3,

Once you run above command new directory py3 will be created. Now We need to activate our new py3 environment

your prompt will be changed to (py3) Code/Django/myapp  Now Install Django. Notice we are not running pip3 command, we will just  run pip inside virtualenv

Once Django is installed, you can check the version by

Lets start new project call makeinindia

Lets start new app blog

Now we will start the server

Finally done, Whenever you want to leave the virtual environment just run to

Dont forget  to run this command Every time you want to work with your Django app