In this post you’re going to learn how to install python web framework (django).
However if you dont know what exactly the django is ?
Check out the comprehensive guide of Best Programming Languages for 2019.
To follow along with this guide, you will need the following installed on your computer:
- Virtual Environment
Let’s dive in and get started!
1. Download & Install Python
In this section, we will download the stable release or the latest version of python programming language from their official website.
After downloading, run .exe file locally.
And make sure to check the box
Add Python 3.6 To Path.
If you click on customize installation make sure to install pip version along with python installation.After successful installation next step is...
2. Install Virtual Env
We are done with the basic installation of python. Now we will install the virtual environment for django.
Open up the Command Prompt / Windows PowerShell for windows users with the
And for the Mac or Linux users simply open up the terminal and type the following command.
pip install virtualenv
3. Install Django
Finally, we will install the django with this basic command.
pip install django
if you want to install specific version of django then you will execute the command like this.
pip install django==1.11.4
Hurrah! the django is installed successfully on your system.
Multiple Virtual Environments for different Django Versions
This section is amazing , in which we will discuss how to make multiple virtual environments for different django versions and projects.
Suppose i have a project that requires django version 1.11.4, and i also work on the other project that requires django version 2.1.5.
Both projects have different versions of django and other packages. So for this purpose we need separate virtual environments on our local machine.
Here is the 4 steps process that clearly demonstrates that how you work with different versions.
1. Check the currently installed Virtual Env and django version.
virtualenv --version django-admin.py version
2. Install Virtual Env Wrapper for this purpose.
pip install virtualenvwrapper-win
3. Separate Virtual Env Folder will created automatically (see example).
4. In Envs folder create separate virtual environments for separate django projects with these commands.
mkvirtualenv Project_With_Django_1.11 workon Project_With_Django_1.11 pip install django==1.11.4
mkvirtualenv Project_With_Django_2.1.5 workon Project_With_Django_2.1.5 pip install django==2.1.5
I'm sure you like this post. However, if you have any issue regarding this post or methods comment with your thoughts in the comment section.
After all here is the best django website templates and themes to kick start your python & django development.