How to Install Django 3 on Ubuntu 18.04

How to Install Django 3 on Ubuntu 18.04

Django is an open source web framework written in the Python programming language. Django’s strengths are rapid development, scalability, and reusability.

In this tutorial, we will install Django 3 for development environment on Ubuntu 18.04.

0. Software Requirements

Software requirements to install Django 3:

  • Python 3
  • pip 3
  • virtualenv

1.Install pip

pip is the package manager for Python packages. With pip we install and manage the additional libraries and dependencies needed.

Install pip untuk Python 3.

Verify pip installation.

2.Install virtualenv

virtualenv is a virtual environment intended for Python applications. By using virtualenv, each Python application project is isolated with the global environment of the operating system. Isolation of Python environment can prevent package conflicts between Python application projects and operating system environment.

Install virtualenv.

Verify virtualenv installation.

3.Install Django

Install Django in virtualenv using pip.

Create django-apps directory.

Create a virtual environment with the name env.

Activate the virtual environment.

After activating the virtual environment, there is a (env) prefix as a sign that the virtual environment is active.

Install Django using pip.

Verify Django installation.

4.Create Django Project

Create a Django project with the name djangodemo.

Run Django development server.

The results of the command run the development server.

Development server runs on port 8000.

Browse http://127.0.0.1:8000.

Django test page

To stop the development server press CTRL + C .

To deactivate the virtual environment, run the deactivate command.

Leave a Reply

Your email address will not be published. Required fields are marked *