Skip to main content

Deploy Django to Render

This page explains how to deploy Django on Render

Render fully supports Python-based applications and this page explains the steps that any developer can follow and deploy their apps using a minimal configuration.

Any Django project can be deployed in two ways:

  • As a Service: the deployed app runs standalone (not connected with other services)
  • As a Blueprint, where the Django App can be connected with other local services like cron, background tasks, or a React UI.

This page covers the case when Django is deployed as a service.

✅ Deploy as a Service​

To deploy Django as a service, the steps are:

  • Create a new Render account using GitHub
    • Using GitHub for authentication facilitates the deployment of the project from the sources directly
  • Navigate to the main Dashboard
  • Create a New Service
  • Connect a GitHub Repository. For DEMO we will use:
  • Configure the project
    • Name
    • Runtime: Needs to be Python
    • Build Command
      • this is responsible to install modules, collect statics, and build DB
    • Start Command
      • here we need to call Gunicorn using the app entry point as input
    • Select the Instance Type
      • For this DEMO we will use a free one
    • Optionally, we can specify ENV Variables, and disable the auto-deploy
    • Confirm the action
      • click on Create Service

The steps with the related screens, are listed below:

Create new Service​

Render - Create Service


Connect a GitHub Repository​

This demonstration uses Datta Able Django

Render - Connect Repo


Naming the Service​

Render - Configure Name


Configure the Service​

This step is quite important because we need to inform Render that our project needs Python to run, and also what should be executed before going live. This open-source starter combines the build set up in single file named build.sh responsible with the following tasks:

  • Upgrade PIP (recommended to use a newer version)
  • Install modules via PIP
  • Collect Static
  • Migrate DB

Another important setting is the Start Command that specify the entry point to be used by Gunicorn. For this starter, this is the value.

$ gunicorn core.wsgi:application

Render - Configure Runtime Environment, Build Command


Configure the Instance​

Here we have two options: Free & Paid. For this deployment, a free instance was selected.

Render - Configure Instance Type (free or PAID)


Confirm & View Deployment Logs​

Once the above set up is confirmed, Render will create a new page for the sevice where we can visualize the deployment logs and later, update the service settings.

Render - Visualize Deployment Logs


Access the LIVE Deployment​

At this point, the app should be up & running in the same way as Datta Able Deployment

Render - Datta Able is LIVE


✅ Resources​