Follow these steps to get the project up and running using Docker:
-
Open Docker Desktop
Make sure Docker Desktop is running on your machine. -
Navigate to the Project Folder
Open a terminal and navigate to the project directory. Run the following command to Navigate to correct directory:cd django_advanced
-
Create env file
Open a terminal and navigate to the project directory. Run the following command to Add this content in .env file inside django_advanced:SECRET_KEY=django-insecure-b-_!c)u97$+nbv%s-cciawiqsjwdp6dvg71)4)k3&da$sx-b4y DEBUG=True DJANGO_ALLOWED_HOSTS= DJANGO_SETTINGS_MODULE=django_advanced.settings DATABASE_NAME=django_advanced_db DATABASE_USER=postgres DATABASE_PASSWORD=admin DATABASE_HOST=db DATABASE_PORT=5432 POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=admin EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_USE_SSL=True EMAIL_HOST_USER=testtest@gmail.com DEFAULT_FROM_EMAIL=testtest@gmail.com EMAIL_HOST_PASSWORD=testtest@gmail.com
-
Build the Docker Images
Open a terminal and navigate to the project directory. Run the following command to build the Docker images:docker-compose build
-
Start the Docker Containers
After the build process is complete, run the following command to start the Docker containers:docker-compose up
-
Access the Application Open your web browser and navigate to:
http://localhost:8000