DevOps complete guide: Deploying a Django application to AWS Fargate and CloudFront using AWS CDK with Route53 custom domain name

Joel Wembo
Django Unleashed
Published in
27 min readApr 4, 2024

--

Serverless Django refers to the practice of deploying Django applications in a serverless environment, where the infrastructure provisioning and management are handled by a cloud provider. This means developers can run their Django code without worrying about servers, operating systems, or scaling challenges. Deploying a Django application on AWS Fargate is a great choice for scalability and ease of maintenance.

serverless django cdk by joel wembo
Django ECR , ECS and RDS Stack

Table of Contents

· Table of Contents
· Abstract
· Introduction
· Prerequisites:
· 1. Let Start with Django
· 2. Let Dockerize the Django application
· 3. AWS CDK Setup
· Open your IDE #
· Explore your project directory #
· 4. Create AWS Access Keys
· 5. Set Up Custom Domain
· 6. Create Route53 Hosted Zone
· 7. CI/CD Workflows Setup with Github Actions
· 8. Django ECS
· 9. AWS RDS Aurora MySQL
· 10. Settings.py
· 11. Deploying static files to S3 bucket
· 12. Main Django Construct
· 13. get-config.ts
· 14. Define Entry point of the CDK application
· 15. Setup and permissions of the django IAM database user
· 16. function to initialize the database
· 17. Test your solution
· 18. Check result in your AWS Management Console
· Summary
· About me
· References

--

--

Joel Wembo
Django Unleashed

I am a Cloud Solutions Architect @ prodxcloud. Expert in Django, AWS, AWS CDK, EKS, Serverless Computing & Terraform. https://www.linkedin.com/in/joelotepawembo