Skip to content

Asif-GD/a-django-to-do-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A To Do List

A "To Do List" web-app created using Python-Django framework, and Redis as a primary database using Redis OM for Python.

App Screenshots

/home

image

/login

image

/register

image

/lists

image

/tasks

image

Data Models

  1. List Data Model

    • username: string type -> indexed
    • list_name: string type
  2. Task Data Model

    • list_pk: string type -> indexed
    • task_name: string type
    • task_complete: Optional boolean type

How it works

  • The web-app uses SQLite3, the default django database for storing User models. I chose to do this in order to utilize the built-in django modules for User Creation & Authentication.
  • The primary database is Redis with data models implemented using Redis OM in Python.
  • The To Do Lists created by the user are tagged to them via their username and can be retrieved, hence the username field is indexed.
  • The Tasks are tagged to the list by retriving the list's primary key and storing it along with the task.
  • The primary key of the list is stored into list_pk inside the Task data model, and that field is indexed.
  • Upon searching for the user's lists, they are authenticated and all the user's list are retrieved as links.
  • Accessing the Lists will lead to their individual tasks under them.
  • The links for the lists are generated using their list's primary key. note - This caused errors inorder to access the other URLs, so I have unimplemented (commented out the URL in main/urls.py) it for now.

How to run it locally?

Prerequisites

Python3, Docker

  • Create a Redis-Stack Docker image. I developed the app by connecting to a local instance of a Redis Database, the link explains it better.
  • Setup a virtual environment for the project using pipenv, and activate it.
  • Clone the repository
  • The necessary packages should be installed automatically using the information from the PipFile
  • Run the server using
    • python manage.py runserver - Windows

More Information about Redis Stack

Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.

Getting Started

  1. Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. Redis Stack getting started page - Lists all the Redis Stack features. From there you can find relevant docs and tutorials for all the capabilities of Redis Stack.
  3. Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
  4. RedisInsight - Desktop GUI tool - Use this to connect to Redis to visually see the data. It also has a CLI inside it that lets you send Redis CLI commands. It also has a profiler so you can see commands that are run on your Redis instance in real-time
  5. Youtube Videos