Creating a Django app

An app in the Django ecosystem refers to an application that handles a specific function within a site. For instance, our default project comes with the profile and account apps already. With the terminology clarified, we are set to build an app to display the latest price of bitcoin.

We should keep our development server running in the background. When the server detects any changes to our code base, it will reload automatically to reflect the changes. Therefore, right now, we need to launch a new Terminal and attach to the running server container:

docker exec -it 377bfb2f3db4 bash

The strange-looking numbers before bash refer to the ID of the container. We can find the ID from the terminal that holds the running server:

Alternatively, we can get the IDs of all running containers by issuing the following command:

docker ps -a

The docker exec command helps you go back to the same Bash environment as the development server. We can now start a new app:

cd /app/crypto_stats/src
python manage.py startapp bitcoin

Inside the host computer's project directory, we should be able to see a new bitcoin folder inside crypto_stats/src/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.129.65