How To Install python3-djangorestframework on Ubuntu 18.04

In this tutorial we learn how to install python3-djangorestframework on Ubuntu 18.04. python3-djangorestframework is Web APIs for Django, made easy for Python3

Introduction

In this tutorial we learn how to install python3-djangorestframework on Ubuntu 18.04.

What is python3-djangorestframework

python3-djangorestframework is:

For Python3. powerful and flexible toolkit that makes it easy to build Web APIs. Some reasons you might want to use REST framework:

  • The Web browseable API is a huge useability win for your developers.
  • Authentication policies including OAuth1a and OAuth2 out of the box.
  • Serialization that supports both ORM and non-ORM data sources.
  • Customizable all the way down - just use regular function-based views if you don’t need the more powerful features.
  • Extensive documentation, and great community support.

There are three methods to install python3-djangorestframework on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-djangorestframework Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python3-djangorestframework using apt-get by running the following command:

sudo apt-get -y install python3-djangorestframework

Install python3-djangorestframework Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python3-djangorestframework using apt by running the following command:

sudo apt -y install python3-djangorestframework

Install python3-djangorestframework Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python3-djangorestframework using aptitude by running the following command:

sudo aptitude -y install python3-djangorestframework

How To Uninstall python3-djangorestframework on Ubuntu 18.04

To uninstall only the python3-djangorestframework package we can use the following command:

sudo apt-get remove python3-djangorestframework

Uninstall python3-djangorestframework And Its Dependencies

To uninstall python3-djangorestframework and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python3-djangorestframework

Remove python3-djangorestframework Configurations and Data

To remove python3-djangorestframework configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python3-djangorestframework

Remove python3-djangorestframework configuration, data, and all of its dependencies

We can use the following command to remove python3-djangorestframework configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python3-djangorestframework

References

Summary

In this tutorial we learn how to install python3-djangorestframework package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.