-
Clone the repository:
git clone https://github.com/Calici/Django-Redis-InMemoryStorageHandler.git
-
Change to the cloned repository directory:
cd Django-Redis-InMemoryStorageHandler
-
Install the required package using pip:
pip install django4-background-tasks
-
Start the Docker container for Redis in detached mode:
docker-compose up -d
-
Run the Django server:
python manage.py runserver
Note: If you visit the page, you may not see anything displayed.
-
Allows the use of the RefreshHandler function for Background Task handling(Write on new terminal):
python manage.py process_tasks
-
Run the tests(Write on new terminal):
python manage.py test
Files to check related to the in-memory cache:
docker-compose.yaml
: Run a dockerized Redis Serversrc/refreshHandler.py
:src/requestHandler.py
: Request Handling + Redis Schema Specification within the Request Handlersrc/tests.py
: Unit Testssrc/app.py
(calls therefreshHandler
)src/urls.py
Redis/settings.py
(refer to this link for more information)