Deploying a Django application to a server


Lesson 13 of 14 · Python for the web

So far we have made our first Django web application.

However, the application currently runs only on our local computer.

For the application to be available to other users on the internet, we have to put it on a web server.

The process of putting an application on a server is called deployment (deploy).

What is deployment?

Deployment means putting an application on a server that can be reached over the internet.

When we put the application on a server, users can visit the site through a URL address.

For example:

https://my-site.com

What does the deployment process look like?

Deploying a Django application usually involves several steps:

  • putting the application on the server
  • installing the required Python packages
  • setting up the database
  • setting up the web server
  • starting the application
In practice, cloud platforms that make this process simpler are often used.

Popular platforms for Python applications

  • Heroku
  • PythonAnywhere
  • DigitalOcean
  • AWS
  • Render

These platforms make it easy to run Python web applications.


An example: deploying to Heroku

One of the most popular platforms for beginners is Heroku.

Heroku lets you deploy Python applications quickly without complicated configuration.

Steps for deploying to Heroku

  • create an account
  • put the project in Git
  • connect it to the Heroku platform
  • start the application

A detailed tutorial

If you want a detailed explanation, see the following guide:

In that tutorial you will see the complete process of deploying an application.


What happens after deployment?

Once the application is on the server:

  • the site becomes available on the internet
  • users can open the application
  • new features can be added
  • the application can grow and develop
Most professional web applications are constantly improved and upgraded.

Frequently asked questions

What does deploy mean?

Deploy means putting an application on a server so that it is available on the internet.

Can a Django application run locally?

Yes. During development the application runs on a local server.

Which platform is best for beginners?

Heroku and PythonAnywhere are often the simplest to start with.

Do I need to know Linux to deploy?

For more advanced servers you do, but many cloud platforms make the process simpler.