-
Set your environment variables by creating your own
.env
file in root similar to.env.example
.- Specify
DJANGO_SECRET_KEY
. It can be generated asbase64 /dev/urandom | head -c50
. - All Other configuration in
.env.example
is ready for local development.
- Specify
-
Build and run docker containers
- Run following command in base directory of this project:
docker-compose up --build -d
- Docker image for this application will be automatically built. Then, all necessary infrastructure (e.g. database) will be run along with web application.
-
Run database migrations
- Create all necessary tables in database by executing:
docker-compose exec web pipenv run migrate
-
Run
docker-compose up
in base directory of this project. -
Visit http://localhost:8000 in your browser.
-
To stop the server, use
docker-compose down
We created a fake real world data. The fixtures are present in /fixtures
directory.
docker-compose exec web pipenv run loaddata
If something went wrong with migrations, you can remove all migrations using following command:
docker-compose exec web pipenv run reset
Before committing, format code using black
formater:
docker-compose exec web pipenv run lint
Run unit tests using following command:
docker-compose exec web pipenv run test