This project is a small Django based Rest API that will allow you to create lists and tasks, and will allow you to mark a task as completed.
Clone the project
git clone https://github.com/codeplatoon-devops/to-do-list-django.gitGo to the project directory
cd to-do-list-djangoCreate and activate Virtual Environment
python -m venv `name_of_env`
source `name_of_env`/bin/activateInstall dependencies
pip install -r requirements.txtCreate your database
createdb to_doCreate .env file
touch .envGenerate secret key and add it to your .env file under SECRET_KEY
# this will generate a secret key copy and paste it onto your .env file under the variable SECRET_KEY
python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'Migrate migrations
python manage.py migrateStart the server
python manage.py runserver GET /api/v1/lists/ GET /api/v1/lists/<int:id>/| Parameter | Type | Description |
|---|---|---|
id |
int |
Required. ID/PK of desired list |
GET /api/v1/list/<int:id>/todos/<int:item_id>/| Parameter | Type | Description |
|---|---|---|
id |
int |
Required. ID/PK of desired list |
item_id |
int |
Required. ID/PK of desired task |
POST /api/v1/lists/| Parameter | Type | Description |
|---|---|---|
name |
str |
Required. Title of the list to be created |
POST /api/v1/lists/<int:id>/todos/| Parameter | Type | Description |
|---|---|---|
id |
int |
Required. ID/PK of desired list |
| Parameter | Type | Description |
|---|---|---|
name |
str |
Required. Title of the task to be created |
PUT /api/v1/list/<int:id>/todos/<int:item_id>/complete/| Parameter | Type | Description |
|---|---|---|
id |
int |
Required. ID/PK of desired list |
item_id |
int |
Required. ID/PK of desired task |
Download postman here. It has an excellent free tier - do not worry about signing up for anything. Insomnia is a popular open-source alternative however postman is still more widely used in the industry and is the tool we will use most in this course.
Use postman to make http requests to your web app once its running. Depending on the host (localhost vs an ec2 instance) you may have to modify the urls in the example here. You will also want to change the id values used to create new todo lists and items, etc.
Download this json file with a postman collection for this app. Then in postman go to "File > Import" and then import