Django Project Deployment: AWS, Vercel, and Railway

Table of Contents:

Introduction

A Guide to Choosing the Right Hosting Service

Where to Start

Advantages and Disadvantages (AWS, Vercel, Railway)

How to Decide on the “Right” Hosting Service

Deploying a Django Project on AWS

EC2 vs. Elastic Beanstalk (EB)

Deploying on AWS: The Hard (but Better) Way (EC2)

Deploying on AWS: The Easy Way (EB)

Deploying A Django Project on Railway

Deploying A Django Project on Vercel

Introduction

This article will specifically focus on the deployment of a new Django project. Primarily, this will serve as an initial introduction to some current popular hosting services (AWS, Vercel, and Railway), serving as more of a guide to understanding which platform is right for you and your team before. Once you feel confident on the platform that you wish to deploy on, we will then go into detail on how to successfully deploy your new Django project. After reading this article, you should hopefully have enough knowledge and resources to know which hosting service is best for you (and your team) and start deploying your Django project.

Note: For the sake of consistency, no prior knowledge of DevOps or deployment will be assumed.

A Guide to Choosing the Right Hosting Service

Where to Start

Advantages and Disadvantages (AWS, Vercel, Railway)

It is highly suggested you read through the following table carefully to learn which service you and your team may prefer before continuing:

Criteria AWS (EC2/EB) Vercel Railway
Complexity (Deployment Difficulty) <ul><li>The most difficult to deploy on</li></ul> <ul><li>Relatively easy to deploy</li></ul> <ul><li>The easiest platform to deploy on</li></ul>
Price of Hosting (Price Charged for Hosting Time) <ul><li>Completely free-to-use and host on (for 1 project of your choice)</li></ul> <ul><li>Completely free-to-use and host on (for 1 project of your choice)</li></ul> <ul><li>Free-to-use for only ~3 weeks per month</li></ul>
Price of Storage (Price Charged for Hosting Storage) <ul><li>Completely free</li></ul> <ul><li>Only enough to store code behind Django</li><li>No storage for SQLite Database and media files</li></ul> <ul><li>Free until 100GB of total storage</li></ul>
Security <ul><li>Minimal security</li><li>SSL certificate to communicate over HTTPS requires a paid for domain</li><li>Process to obtain SSL certificate with domain can be daunting</li></ul> <ul><li>As Vercel own their own domain, all hosted services communicate over HTTPS for free</li></ul> <ul><li>As Railway own their own domain, all hosted services communicate over HTTPS for free</li></ul>
Longevity <ul><li>Most stable in the long-term (storage and reliability wise)</li></ul> <ul><li>Least stable in the long term for larger backend servers</li><li>Consider whether usage is purely API based, or also includes storage</li></ul> <ul><li>Relatively reliable for long term projects</li><li>Consider growth of backend (and potential SQLite Database)</li></ul>
Best Features <ul><li>Customizability (multiple ways to deploy)</li><li>Most valued among employees to learn</li><li>Essentially unlimited storage and hosting for free (for 1 hosted service)</li></ul> <ul><li>Automated deployment is made very easy (add GitHub Action to your Forked Repo)</li><li>Little to no set-up required</li><li>Easy and free communication over HTTPS</li></ul> <ul><li>Automated deployment is made very easy (add GitHub Action to your Forked Repo)</li><li>Very little set-up required</li><li>Easy and free communication over HTTPS</li></ul>
Pain Points <ul><li>Set-up can be long and complex</li><li>May require learning other tech stacks (e.g. NGINX, Docker)</li><li>Processes to setup automated deployment and acquiring an SSL certificate (for HTTPS communication) are long and complex</li></ul> <ul><li>No free storage for SQLite Database and potentially even code</li><li>Must use external database (e.g. MongoDB) in tandem</li></ul> <ul><li>Month-to-month expense in hosting time</li><li>Free storage until 100GB requires entering Credit Card information</li><li>Sans payment details, hosting service offers 1GB of storage</li></ul>

How to Decide on the Right Hosting Service

Deploying a Django Project on AWS

EC2 vs. Elastic Beanstalk (EB)

Deploying on AWS: The Hard (but Better) Way (EC2)

                                      [![](https://markdown-videos.deta.dev/youtube/7O1H9kr1CsA)](https://youtu.be/7O1H9kr1CsA)

Deploying on AWS: The Easy Way (EB)

                                      [![](https://markdown-videos.deta.dev/youtube/51YwXvJ9LOE)](https://youtu.be/51YwXvJ9LOE)

Deploying a Django Project on Railway

                                      [![](https://markdown-videos.deta.dev/youtube/NUqtNglEcCU)](https://youtu.be/NUqtNglEcCU)

Deploying a Django Project on Vercel

                                      [![](https://markdown-videos.deta.dev/youtube/ZjVzHcXCeMU)](https://youtu.be/ZjVzHcXCeMU)