Posts

Showing posts with the label Docker

How to dockerize Django Web application

Image
Hey there, welcome! In this article, I am going to teach you how to package and distribute an API built in  Django   and  Django REST Framework ,  using  Docker  containers. For this article, I used an API I built in  part 1  and  part 2  of my articles on  Django REST Framework  ( DRF). However if you already have an existing Django project you want to containerize right away, you can also follow along as we go, step by step. What is Docker? Docker is an open platform that performs Operating System level virtualization also known as  containerization . Container Vs Virtual Machine — Image Credit: Docker To help you put this into perspective, let’s compare Docker to a Virtual Machine(VM) like  Virtual Box ; A VM will get physical resources like RAM, CPU, Network cards, etc and  “slice and dice”  them into virtual resources. It then provides the virtual resources on top of a hypervisor as smaller Virtual Machines that look and feel like the normal physical computer where you can then in

Using PostgresSQl, Docker and Django

Image
In this tutorial we will create a new Django project using Docker and PostgreSQL. Django ships with built-in SQLite support but even for local development you are better off using a "real" database like PostgreSQL that matches what is in production. It's  possible  to run PostgreSQL locally using a tool like  Postgres.app , however the preferred choice among many developers today is to use  Docker , a tool for creating isolated operating systems. The easiest way to think of it is as a large virtual environment that contains everything needed for our Django project: dependencies, database, caching services, and any other tools needed. A big reason to use Docker is that it completely removes any issues around local development set up. Instead of worrying about which software packages are installed or running a local database alongside a project, you simply run a Docker image of the entire project. Best of all, this can be shared in groups and makes team development muc