hi guys, i’m working on a project and i’d like to optimize site performance through caching and i have identified redis as my in-memory solution, however even though i have my redis server up and running in one instance of my linux distribution on my wsl and another instance running my django server, i dont get TCP request from django server although i’ve applied the settings in django settings.py file and also applied the cache_page method to my model view. can anybody help out with why i cant recieve request on my redis server. here is my settings.py and my assessment.py view
from django.views.decorators.cache import cache_page from api.utils.jwt_utils import get_user_from_request from ..models.assessment import Assessment, Question, Answer from ..models.learner import Learner
from ..models.admin import Admin
from ..serializers.assessment import AssessmentSerializer, QuestionSerializer, AnswerSerializer u/cache_page(60 * 15) u/api_view(['POST']) u/permission_classes([IsAdminUser])
def create_assessment(request):
""" creates an assessment """
if request.method == 'POST': serializer = AssessmentSerializer(data=request.data)
if serializer.is_valid():
# and my cache settings in my settings.py
CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } }
}