How To Install Django on Debian 9 Stretch

Install Django on Debian 9 Stretch

In this tutorial we will show you how to install and configure Django on Debian 9. For those of you who didn’t know, Django is the most popular Python web framework designed to help developers build secure, scalable and maintainable web applications. Django is free and open source software.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Django on a Debian 9 (Stretch) server.

Install Django on Debian 9 Stretch

Step 1. Before we install any software, it’s important to make sure your system is up to date by running these following apt-get commands in the terminal:

Step 2. Installing PIP and necessary dependencies.

Now you can install pip using the following command:

Step 3. Creating Virtual Environment.

Create a new directory for your Django application and navigate into it:

Next, execute the following command to create a new virtual environment:

To start using the virtual environment, activate it by running the activate script:

Step 4. Installing Djanggo on Debian 9.

Once the pip is installed, run the following command to install Django:

You can test that the installation was successful by typing:

Step 5. Create a sample Django project.

Now that the Django framework has been installed, you can give it a test drive by creating a sample project:

The command above will create a directory myproject in your working directory ~, and store all necessary files within.

Run the commands below in sequence to get your application started. Follow the instructions on screen to provide the superuser’s credentials:

Step 6. Accessing Django.

Django will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8000 or http://server-ip:8000/admin

Install Django on Debian 9 Stretch

Congratulation’s! You have successfully installed Django. Thanks for using this tutorial for installing Django web framework on Debian 9 Stretch server. For additional help or useful information, we recommend you to check the official Django web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save