Skip to content

madanimohadhabib/Deploy-a-Django-app-on-render-using-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy-a-Django-app-on-render-using-docker

This guide will help you deploy a Django web application on Render using Docker containers. Render is a cloud platform that simplifies deployment, scaling, and hosting of web applications.

Prerequisites

  • A Django web application (if you don't have one, you can follow the Django tutorial).
  • A GitHub account for version control.
  • A Render account to host your application.
  1. Log in to your Render account.
  2. Click on "New" and select "Service."
  3. Choose a name for your service and select the GitHub repository where your Django app is hosted.
  4. Render will automatically detect your app's language and provide a build environment. Make sure it's set to "Docker."
  5. Configure the following environment variables in the "Environment" section:
    • DJANGO_SECRET_KEY: Your Django app's secret key.
    • DJANGO_DEBUG: Set to False for production.
    • Other necessary environment variables (e.g., database connection details).
  6. In the "Build" section, use the following Dockerfile:
#Use the official Python image as the base image
FROM python:3.8

#Set environment variable for unbuffered Python output
ENV PYTHONBUFFERED=1

#Set the working directory in the container
WORKDIR /django

#Copy the requirements file into the container
COPY requirements.txt requirements.txt

#Install project dependencies
RUN pip install -r requirements.txt

#Copy the Django project code into the container
COPY .

#Start the Django application
CMD python manage.py runserver 0.0.0.0:8000
  1. Save your configuration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published