Dear Reader, this article is not intended to explain anything about Django but just listing all the command to be executed in order to create a django project and an application. If you are very beginner, Here are some new terms for you like pip and virtual environment.
Pip: Pip is a standard package-management system for packages written in python. It is just like npm for node, apt for linux/ubuntu and used in the same way to install and manage software packages.
Virtual environment (virtualenv): It is a tool used to create an isolated Python environment. When you create a virtualenv, it creates a directory with the name defined at the time of creation of virtualenv. Now, whenever your python project needs a package and you install that package using pip, all the necessary executables files are stored in virtualenv directory.
You can execute these command in the order listed here:
- Install pip
apt install python3-pip
- Install virtual environment
pip3 install virtualenv
- Create a directory
mkdir django-project cd django-project
- Create virtual environment
Syntax: virtualenv -p <pythonVersion> <virtualEnvironmentName>
virtualenv -p python3.6 venv_django
- Activate virtual environment
- Install django
Make sure that your virtual environment is activated and you are installing django in your virtual environment
pip install Django
- Create django project
python venv_django/bin/django-admin.py startproject core