Giter VIP home page Giter VIP logo

todo-list's Introduction

Todo list

Simple todo list REST API

Archived

Prerequisites

  • Python3.6+
  • Python IDE
  • Redis server (for caching)

Make sure to install redis before you proceed

Setup

  1. Clone the repo and install the requirements (pip install -r requirements.txt)

  2. Create .env file and configure environmental variables

Example content:

SECRET_KEY=Some-Generated-Secret-Key
DATABASE_URL=sqlite:///db.sqlite3
REDIS_CACHE_URL=redis://localhost:6379/1
DEBUG=True
  1. Make migrations & migrate
python manage.py makemigrations
python manage.py migrate

It's ready! Unless you want to deploy it elsewhere...

Deployment

Make sure to install docker and docker-compose before we start

  1. Change env variables in Dockerfile, currently:
ENV SECRET_KEY=Some-Generated-Secret-Key
ENV DATABASE_URL=sqlite:///db.sqlite3
ENV REDIS_CACHE_URL=redis://redis:6379/1
ENV DEBUG=False

Note: it will override .env file that is currently in app directory

  1. Run

    To build docker-compose build

    To run docker-compose up

Docker compose will run two containers: django app and redis server

#Example requests

All the requests can be found here (Postman)

Here is some request - response snippets:

  1. POST /categories
    {
         "title": "In progress",
         "description": "in progress todos",
         "todos": [
             {
                 "title": "appboxo task",
                 "description": "appboxo screening task"
             },
             {
                 "title": "spring mvc pet-project",
                 "description": "just for fun"
             }
         ]
    }
    

    Response:

    201 CREATED
    
    {
        "id": 1,
        "title": "In progress",
        "description": "in progress todos",
        "todos": [
            {
                "id": 1,
                "title": "appboxo task",
                "description": "appboxo screening task"
            },
            {
                "id": 2,
                "title": "spring mvc pet-project",
                "description": "just for fun"
            }
        ]
    }
    
  2. GET /todo/1
    
    {
       "id": 1,
       "title": "appboxo task",
       "description": "appboxo screening task",
       "category": "In progress"
    }
    

todo-list's People

Contributors

yeraassyl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.