Creating the Houses App with Django

Learn how to create a Django application in Docker.

Navigating the Docker container

To create a new app inside an existing or running Docker container, we must first go into the container and locate the service in which we want to create the application. In our case, we have to shell into our backend service inside the Docker container with the following command:

docker-compose exec backend sh

Creating the new app

Once we are inside the backend service in the container, we can start creating the app. Since it is a Django app that we want to create, we can now issue the following command:

django-admin startapp houses

We can also use:

python3 manage.py startapp houses


Any of these will create the Houses app in the backend service inside the Docker container.

The Houses app content

Once the Houses app is created, we'll have ...