Example reimplementation of ConceptLibrary to demonstrate how a refactor could help us improve performance
Boilerplate ref @ https://github.com/JackScanlon/DjangoBoilerplateExample
Note: The default params for this development account can be changed in
./env/app.compose.env
, or you can make changes to the tool in./app/tools/create_superuser.py
When Debug=1
the app will create a superuser with the username of admin
([email protected]) and a password of admin
.
- Create a virtual environment:
python -m venv venv
- Install requirements
pip install -r requirements.txt
- References to the assoc. packages will now be available in your editor and/or IDE.
Note: ElasticSearch may complain that you do not have enough memory on your VM.
If you're using Windows as your local machine, you can run the following command to solve this issue:
wsl -d docker-desktop sysctl -w vm.max_map_count=262144
- Change the env variables in
./env
, esp. ensuring thatDEBUG=0
- In the root directory of the repo, run the following:
docker-compose -f docker-compose.prod.yml build
- Now run:
docker-compose -f docker-compose.prod.yml up
- Navigate to http://localhost:8000
- Change the env variables in
./env
, esp. ensuring thatDEBUG=1
- In the root directory of the repo, run the following:
docker-compose -f docker-compose.dev.yml build
- Now run:
docker-compose -f docker-compose.dev.yml up
- Navigate to http://localhost:8008
docker-compose -f docker-compose.dev.yml down
docker-compose -f docker-compose.prod.yml down
Note: The following will remove all dangling images, incl. those not assoc. with the boilerplate (be careful!)
docker rmi -f $(docker images -aq)
Note: The following will remove all dangling images, incl. those not assoc. with the boilerplate (be careful!)
docker volume rm $(docker volume ls -qf dangling=true)