NitorAssessmentPortal is an internal assessment portal for Nitor Infotech Pvt. Ltd.
- Local application setup guide (One time setup)
- Running the application
- Generate entity relationship from models
- Extras and References
- Clone the repository, go to the cloned directory using command line
- Build the image
DOCKER_BUILDKIT=0 docker-compose build --no-cache
- Run the containers
docker-compose up -d
- Check if services/containers are up or not using below commands:
docker-compose ps
- Check logs for each services to see if apps are running within container or not using below command:
e.g.
docker-compose logs service_name_here -f --tail number_of_trail_lines_here
docker-compose logs web -f --tail 100
to see last 100 lines of web container logs. - If already having local postgres database to be migrated to postgres container then follow below steps:
# Dump data from local database pg_dump -U local_db_username -W -F t local_db_name > data.tar # Restore data into postgres container cat data.tar | docker exec -i nitorassessmentportal-postgres-1 pg_restore -U postgres_db_username -d postgres_db_name
- Go to the cloned directory using command line
- Create new migrations:
docker-compose exec web python manage.py makemigrations <rest_of_the_options_here_if_needed>
- Check the migrations:
docker-compose exec web python manage.py showmigrations <rest_of_the_options_here_if_needed>
- Apply the migrations:
docker-compose exec web python manage.py migrate <rest_of_the_options_here_if_needed>
- Go to the cloned directory using command line
- Run below command to create superuser:
docker-compose exec web python manage.py createsuperuser
- Go to the cloned directory
- Activate venv if not already done
source .venv/bin/activate
- Install the git hook script
pre-commit install
Validate if getting the result as pre-commit installed at .git/hooks/pre-commit
- After this before every commit command, unit test will run automatically.
- If you get error:
Executable pytest not found
, please check if virtual environment is activated or not. - Read more on pre-commit
- Go to the cloned directory using command line
- Run below command to down the services/containers:
docker-compose down
- Update .env file as per need. If .env not present please clone .env.example file and create it.
- Run below command to up the services/containers in detached mode if .env is updated:
If .env is not updated then even
docker-compose up -d --force-recreate --remove-orphans
docker-compose up -d
is sufficient
- After setting up the project, go to the cloned directory
- Activate venv if not already done and go to project app directory
source .venv/bin/activate
cd nitoronlinetestportal
- Run below command to generate a
.png
file
./manage.py runserver
manage.py graph_models -a -o models.png
- Restart services
docker-compose restart
- Postman Collection for backend APIs