Create virtual environment and Install Django

First go to the project directory , if you are on mac open terminal and then drug and drop your folder after writing cd to terminal like cd then drug and drop the folder and then press enter. Check current working directory by the following command “pwd”. After that create virtual environment for specific project and run following command

virtualenv env -p python2.7
source env/bin/activate

make sure to change python2.7 to your require version for the application. Like if you want to install it for python 3 environment then use

virtualenv env -p python3.1 
source env/bin/activate

After running activate a specifiq environment created only fo4r this project , You can check by the following command

pip list

To disable virtual environment you can use the following command


Make sure you are on project directory or it will not work. When you are working on several Django project then you have to activate / deactivate virtual environment based on running project.

After enabling virtual environment just check if there have any requirements file. Just run

pip install -r requirements.txt

As usual in every project there should be a file name requirements.txt which is actually requirement file for that specific application you are going to run.

Installing Django:

pip install Django

Starting Django project run the following command startproject myproject

make sure to change myproject as per your project name always.

Separately to install django-cms run the following command

djangocms -s -p . your_project_name

Start Django CMS

python runserver

Run Server

python runserver

this will run the django cms at 9002 port. So you can check it by http://localhost:9002

To create super user use the following command bellow

python createsuperuser

To migrate , run the following command

python migrate

After creating models or changing on models you must need to run migration or change will not be visible. If you make changes on static files like css or js then you have to run the following command to collect static

python collectstatic

Install Django e-Commerce by Oscar :

pip install django-oscar

All common error related fixing for Django projects

If mysql client error run the following command to install it

pip install mysqlclient

Windows Error :

Just go to and then change MIDDLEWARE to MIDDLEWARE_CLASSES


Read More: How to add Call to Action Button under Slider in WordPress

How to Add a Navigation Menu to Sidebar in WordPress

How To Add a PDF Download for Posts in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *