Running locally

First-time setup

Follow these simple instructions to get your development environment up and running smoothly.

1. Unpack the Zip File to Your Desired Directory

After downloading ShipWithDjango, locate the zip file in your downloads folder. Unzip the file and move the contents to the directory where you want to set up your project. This will be your project’s root directory.

2. Open Up a Terminal Inside the Directory

Once the files are unpacked, open your terminal (or command prompt) and navigate to the directory where you placed the ShipWithDjango files. This will be your working directory for the following commands.

3. Make Sure Your Docker Is Running

Before proceeding, ensure that Docker is installed and running on your machine. Docker is essential for containerizing and managing the services required by ShipWithDjango. If Docker isn't running, start it now.

4. Execute "docker compose build"

In your terminal, run the command:

docker compose build

This command will build the Docker containers needed for your project. It may take a few minutes as it pulls and compiles the necessary images and dependencies. Once completed, your environment will be ready to go.

5. Execute "docker compose up"

After the build process is finished, start the containers by running:

docker compose up

This will start all the services required by ShipWithDjango, including the web server, database, and any background processes. Wait for all services to boot up properly; you’ll see logs in the terminal indicating that everything is running smoothly.

6. Open Up a New Terminal in the Same Directory

While keeping the services running, open a new terminal in the same directory. In this terminal, you’ll need to set up the database by running the following commands:

docker compose exec django python manage.py makemigrations
docker compose exec django python manage.py migrate

This step will create and migrate the database schema required for your application. You only need to do this the first time you set up your project.

7. Navigate to http://127.0.0.1:8000/

Once all services are up and running, open your web browser and navigate to http://127.0.0.1:8000/. You should see the default ShipWithDjango homepage, confirming that your local environment is set up correctly.

Running the next times

Once you have completed the initial setup, running your project in the future is straightforward. Anytime you want to start your local development environment, simply navigate to the project directory in your terminal and execute the following command:

docker compose up

This will start all the necessary services and bring your application online. There’s no need to repeat the setup steps—you’re good to go with just this single command!

Congratulations! You’re now running ShipWithDjango locally and ready to start building your project.

Last updated