How to Install Django on Debian 10

Install Django on Debian 10

In this article, we will have explained the necessary steps to install and configure Django on Debian 10. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Django is the most popular web framework which is designed to develop fully-featured Python Web Applications. By using Django you can build secure, scalable and maintainable dynamic web applications.

Install Django on Debian

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install Python virtual environment.

The Django is a framework written in python to develop web applications. Now install python using following command:

You can verify that Python 3 is installed on your system by typing:

Step 3. Install Django on Debian 10.

Install Django using the Python package manager pip:

Verify the installation using the following command which will print the Django version:

Step 4. Create a new Django project.

Now, I will create a new project called linuxtips:

Next, navigate into the linuxtips folder and migrate to set the initial configuration:

Then, you have to create the superuser to manage the project:

The next step is to edit the project configuration file to make it accessible from any computer:

And edit the following entry:

Next, serve the project:

Step 5. Accessing Django.

Open http://127.0.0.1:8000 in your web browser and you will be presented with the default Django landing page:

Install Django on Debian 10

Congratulation, you have learned how to install and configure Django on Debian 10 Buster. If you have any question, please leave a comment below.