- Description of Task
In this assignment, you will be implementing the following using Django
Create two models as follows:-\- Task -> task should have task_type(integer) and task_desc(string)
- TaskTracker -> tracker should have task_type(type of task to track), update_type(per day, weekly or monthly) and email
- Create apis to create and update tasks, task types can be pre-defined(let's say 1,2,3 and 4). Throw error if task type is not valid
- Create api to create TaskTracker.
- Create a background task using django-celery which should send email updates to users based on TaskTracker objects.
- Clone the repository using
git clone https://github.com/RifasM/Convin.git
- or
git clone git@github.com:RifasM/Convin.git
- Needs SSH Keys
- Create a virtual environment
vitualenv venv
- Activate the virtual environment
- Ubuntu
source venv/bin/activate
- Windows
cd venv/Scripts
activate
- Ubuntu
pip install -r requirements.txt
- Import
SECRETS (API Keys, DJANGO_SECRET, etc)
into Operating System Environment - Run
celery -A Convin worker -l info
- If no errors, proceed by pressing
Ctrl+C
- Errors - Check if redis is started by running:
redis-server
on terminal- Confirm by
redis-cli ping
- If no errors, proceed by pressing
- On a separate terminal
celery -A Convin beat -l info
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
- Follow steps to create your account
python manage.py runserver
- Navigate to
localhost:8000
- Log in to Created Account to query on endpoints
- Authenticated Users allowed to make calls such as
PUT
,POST
,DELETE
- Un-Authenticated Users allowed to view
- Click on the endpoint to avail options such as
POST
andDELETE
- Added Checks to check for duplicated emails
- Emails send using Celery Task with Redis at Scheduled times
- Weekly -> Every Monday
- Daily -> Every day at 5 pm
- Monthly -> First day of month
- Click here