| by Arround The Web | No comments

How to Install Django on Linux Mint 21

Looking for an easy and robust way to make web applications then try the Django framework as it requires less lines of code and is highly scalable. Its framework is based on Python; if you have sound knowledge of the Python programming language then it would be of great help. If you are interested in using this Django framework for web-based applications then you need to to install it on Linux Mint 21 so read this guide to get complete information on its installation.

Installing Django on Linux Mint 21

Django as mentioned above is the Python based framework that comes under the top choices for developing web-based applications. To install this framework on Linux Mint there are two ways that one can try and those are:

Installing Django Using Default Package Manager

One of the easiest ways to install Django framework on Linux Mint is by using its default package manager, below are some steps that one needs to follow to install it using apt:

Step 1: First update the packages list of apt package manager of your Linux Mint and for that purpose execute:

$ sudo apt update

Step 2: Next, check if Python3 is installed on your Linux Mint; normally it is already installed but if not then read this guide to install Python latest version on Linux Mint 21:

$ python3 -V

Step 3: Next, install the Django framework on Linux Mint 21 using:

$ sudo apt install python3-django -y

Step 4: Once this framework is installed check its version to see if it is installed correctly:

$ django-admin --version

So, this is how one can install Django framework on Linux Mint and to remove this framework completely execute:

$ sudo apt remove --autoremove python3-django -y

Installing Django Using Pip with Virtual Environment

Another way to install Django framework is by using pip installer by creating a virtual environment as using pip installer without creating virtual environment can conflict with the Linux system package manager. Below are some necessary steps that should be followed to install this Python based framework on Linux Mint 21:

Step 1: Install pip installer along with the Python virtual environment on Linux Mint 21 by executing:

$ sudo apt install python3-pip python3-venv

Step 2: Next, make a directory for Django framework and then move to that directory by executing:

$ mkdir ~/Djangoproject

$ cd Djangoproject

Step 3: Next create a virtual environment by stating the name of your choice, in my case I have names it as env:

$ sudo python3 -m venv env

Now it’s time to activate the virtual environment we created above using:

$ source env/bin/activate

Step 4: Now install Django in the virtual environment using pip package installer through:

$ sudo pip install django

Now check the version of the framework installed on Linux Mint 21 to see it is installed correctly or not:

$ django-admin --version

To completely remove this Python based framework from Linux Mint use:

$ sudo pip uninstall django -y

Conclusion

Whenever it comes to developing web-based applications Django mainly comes under discussion between many of the developers as it is a highly scalable and considerably fast framework. On Linux Mint it can be installed by two ways one is by using its default package manager and other is by using pip installer.

Share Button

Source: linuxhint.com

Leave a Reply