Quickstart
Before setting up your Django Easystart environment, you’ll need to make sure you have Docker and Docker Compose installed on your machine. Don’t worry if you don’t have them installed yet - we’ll guide you through the process!
Installing Docker Desktop
First, head on over to the Docker website https://www.docker.com/products/docker-desktop and download and install Docker Desktop for your operating system. This will provide you with everything you need to run Docker on your local machine.
Installing Docker Compose
Next, you’ll need to install Docker Compose. You can do this by following the instructions on the Docker Compose documentation https://docs.docker.com/compose/install/. The installation process should be straightforward, and you should be up and running in no time!
Getting Started
Once you have Docker and Docker Compose installed, you’re all set to start setting up your Django Easystart environment. We’ll guide you through the rest of the process in this documentation. If you run into any issues, don’t hesitate to reach out to our support team - we’re here to help!
Enter the project directory
cd {{ project_name }}
Set up source control
We recommend you to use git for source control. To install git visit the official documentation https://git-scm.com/downloads and then run the following commands:
git init
git add .
git commit -m "initial commit"
Creating the dev environment file for Development
To get started, you’ll need to create a file named dev inside the ./compose/.env
directory, which is necessary for
using docker-compose. We’ve included some sample configuration files for both development and production.
To create the dev file, simply copy the contents of dev-sample and paste it into dev. To do this quickly, you can use the following command:
cp compose/.env/dev-sample compose/.env/dev
Build the containers
docker compose build
Launch the dev environment
docker compose up -d
Generate translations file
docker compose exec applocal python manage.py compilemessages
docker compose exec applocal python manage.py generate_i18n_js static/js/translation
Load fixtures
docker compose exec applocal python manage.py loaddata fixtures/*.json
Sync permissions to the database
docker compose exec applocal python manage.py runscript sync_permissions
Compile frontend assets
Open a new terminal to build the frontend on watch mode
docker-compose -f docker-compose.yml exec applocal npm install
docker-compose -f docker-compose.yml exec applocal npm run tailwind
docker-compose -f docker-compose.yml exec applocal npm run start
Load development server
Open your browser at http://localhost:8000
Make
All commands above can be simplified by executing make init
, inspect the Makefile in the root of your project to see all the available make tasks.
Stop the development server
To stop the docker containers execute the following command: docker compose down
Reset the database
In order to reset the database you should destroy the docker containers executing the following command
docker compose down -v
and then bringing up the containers again using:
docker compose up -d
.
If you reset the database you must execute all the parts in the Getting Started
section of this tutorial.