Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
140 views

As a simple test, I'm attempting to set the cache backend used by Django to something other than the default django.core.cache.backends.locmem.LocMemCache. I'm using a custom backend defined in the ...
0 votes
1 answer
43 views

settings.py ['django.middleware.cache.UpdateCacheMiddleware'] + MIDDLEWARE + ['django.middleware.cache.FetchFromCacheMiddleware'] middleware.py def middleware(request): if global_value % ...
1 vote
0 answers
53 views

Here is the sample code: class CrossSection(LoggerMixin): pass class CrossSectionFactory(LoggerMixin): cross_section_sequence = {} def add(self, date): cross_section = ...
sinall's user avatar
  • 11
1 vote
3 answers
73 views

I can use these cache methods set(), get(), touch(), incr(), decr(), incr_version(), decr_version(), delete(), delete_many(), clear() and close() as shown below: from django.core.cache import cache ...
0 votes
1 answer
105 views

I found cache.close() saying below in the doc. *I'm learning Django Cache: You can close the connection to your cache with close() if implemented by the cache backend. So, I use cache.close() after ...
2 votes
1 answer
498 views

I set 4 cache values with LocMemCache as shown below: from django.core.cache import cache cache.set("first_name", "John") cache.set("last_name", "Smith", ...
2 votes
2 answers
183 views

If I only set and get David with version=0, then I can get John and David in order as shown below. *I use LocMemCache which is the default cache in Django and I'm learning Django Cache: from django....
0 votes
0 answers
150 views

Is there a more efficient approach, in addition to relying solely on signals, to promptly update the Django cache in Redis whenever a modification occurs in the database? I have explored the use of ...
2 votes
1 answer
1k views

Is it possible to get key's expire time in Django using Redis cache? Something like: from django.core.cache import cache cache.get_expire('mykey') # 300 (seconds) I tried: cache.ttl('my_key') ...
2 votes
0 answers
337 views

Consider the following code snippet: from django.core.cache import cache cache.delete('key_1') cache.delete('key_2') If i'm using an Instance of Redis as my default cache, will Django create two ...
1 vote
1 answer
363 views

I have been using django's database caching as shown here: https://docs.djangoproject.com/en/4.1/topics/cache/#database-caching Recently I have migrated to redis caching, but I still have the cache ...
0 votes
0 answers
404 views

I have a server on Nginx. It is written with Django and connected to Nginx through Waitress. I have set up a cache in Nginx. My server has both dynamic and static pages. After starting a server, it ...
1 vote
1 answer
1k views

I have implemented cache for my articles views, and have set cache page. Currently the issue that i am facing is when i try to POST request data to create new article, the page remains the same. What ...
10 votes
2 answers
2k views

As described in the documentation, since 4.1 the default behavior for template loading changed drastically. If I understand it right, until 4.0 it worked like this: With DEBUG enabled, the templates ...
2 votes
0 answers
873 views

I'm trying to invalidate a view following this Expire a view-cache in Django?. Here's a view function where I have disabled per-site caching and enabled per-view caching. This is the view, say, that I ...

15 30 50 per page
1
2 3 4 5
...
17

AltStyle によって変換されたページ (->オリジナル) /