Web application to manage shifts and tasks.
Built with Python and Django.
git clone https://github.com/taiyeoguns/shiftmgr-django.git
With a virtualenv already set-up, install the requirements with pip:
pip install -r requirements.txt
Create .env
file from example file and maintain necessary details in it e.g. database details etc
cp .env.example .env
Generate a secret key to be used by the Django application using the command below:
python -c "import string,random; uni=string.ascii_letters+string.digits+string.punctuation; print(repr(''.join([random.SystemRandom().choice(uni) for i in range(random.randint(45,50))])))"
Copy the generated string and add to the .env
file created in previous step.
Create tables in the database:
python manage.py migrate
Install npm
dependencies with Yarn:
yarn
Run tasks to generate assets:
yarn gulp
Start the Django web server by running:
python manage.py runserver
Server should be started at http://localhost:8000
To populate database with sample data, run:
python manage.py seed
num
argument specifies how many items to enter into the tables e.g.
python manage.py seed --num 15
clear
argument specifies to clear the database before seeding e.g.
python manage.py seed --clear
In command prompt, run:
pytest -v
With Docker and Docker Compose set up, run the following commands:
docker-compose up -d
docker-compose exec web_service python manage.py migrate --no-input
docker-compose exec web_service python manage.py seed
docker-compose exec web_service python manage.py collectstatic --no-input
Wait till setup is complete and all containers are started.
Thereafter, application should be available at http://localhost:8000