Skip to content

taiyeoguns/shiftmgr-django

Repository files navigation

ShiftManager

Web application to manage shifts and tasks.

Built with Python and Django.

Requirements

Installation

Clone Project

git clone https://github.com/taiyeoguns/shiftmgr-django.git

Install Requirements

With a virtualenv already set-up, install the requirements with pip:

pip install -r requirements.txt

Add details in .env file

Create .env file from example file and maintain necessary details in it e.g. database details etc

cp .env.example .env

Generate secret key

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.

Run migrations

Create tables in the database:

python manage.py migrate

Install frontend dependencies

Install npm dependencies with Yarn:

yarn

Generate frontent assets

Run tasks to generate assets:

yarn gulp

Start the server

Start the Django web server by running:

python manage.py runserver

Server should be started at http://localhost:8000

Seed database

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

Tests

In command prompt, run:

pytest -v

Run with Docker

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

About

Django application to manage shifts and tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •