How do I not allow Django to cache template, data doesn't change until
several refresh have used @never_cache and cache_control doing everything
well but still not working
On Tue, Feb 1, 2022, 08:59 Mariusz Felisiak
wrote:
> Details are available on the Django project weblog:
>
>
We had a bug in our production system. The timeout was set incorrectly.
Now I want to write a test which checks, that the value of the timeout is
correct.
I look at the docs and don't see a way to **read** the timeout value of a
particular cache-key:
Hi,
When using Django caching backend with celery, I noticed I get an error
“if ord(char) < 33 or ord(char) == 127: TypeError: ord() expected string of
length 1, but int found”
It goes away when I change the yellow highlighted to ‘str(key)’:
--
You received this message because you are
Hi,
I was thinking of using dynamodb as a django cache backend. But I did not
find any lib.
What do you think about this idea?
--
Ezequiel Bertti
https://telegram.me/ebertti
https://twitter.com/ebertti
https://github.com/ebertti
--
You received this message because you are subscribed
I am using(trying) redis as a cache to my django app. This is how I am
trying to do it.
def postview(request):
post_list = []
if cache.get("posts") == None:
post_list = Post.objects.all()
cache.set("posts", post_list, timeout=None)
else :
Thanks I had not caught that but I am not sure if that is the issue.
On Thu, Mar 17, 2016 at 7:39 AM, wrote:
> As an aside, it looks like you're including CommonMiddleware twice.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups
As an aside, it looks like you're including CommonMiddleware twice.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
Setting the key CACHE_MIDDLEWARE_ALIAS to 'default' fixes the issue
Cheers,
Nanda
On Thursday, March 10, 2016 at 5:02:37 PM UTC-8, nav wrote:
>
> Sorry forgot to add the traceback I am getting:
>
> Internal Server Error: /
> Traceback (most recent call last):
> File
>
Sorry forgot to add the traceback I am getting:
Internal Server Error: /
Traceback (most recent call last):
File
"/Users/nchandrasekhar/PycharmProjects/horizon/.venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 88, in get_response
response = middleware_method(request)
Hi,
I am configuring the memcache backend to use with django and have the
following things setup:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
CACHE_MIDDLEWARE_ALIAS =
Oh, my mistake. I did miss the django-cache-machine part.
Anyway, from the sources it seems supported and dependant on
django-redis-cache [0,1]. So, you should installed first.
According to a commit message [0] and an example [2], this should be
in your settings.py:
CACHE_MACHINE_USE_REDIS
Thanks! I got the redis cache set up. What is worrying me is that
django-cache-machine says that you need to use one of its backends for
caching and django-cache-machine doesn't come with one for redis. Just
memcache and localmem. I'm wondering if its safe to just use the redis
cache i've
Hi Mike,
You need a cache backend, you can write it by yourself [0] or use an
existing one [1,2]
[0]
https://docs.djangoproject.com/en/1.6/topics/cache/#using-a-custom-cache-backend
[1] https://github.com/niwibe/django-redis
[2] https://github.com/sebleier/django-redis-cache
On Wed, Apr 23,
Did you figure this out? I'm currently in the same situation.
On Thursday, March 28, 2013 9:56:13 PM UTC-7, Alan Johnson wrote:
>
> How does one configure this? The documentation only explains how to use
> locmem or memcached, and yet the commit logs reference Redis multiple
> times, so it
Hi,
I am trying to use django's cache framework (using file system as
backend). When running development server, everything is fine, but with
apache I cannot make it work. Sometimes is working, sometimes not.
This is in my settings.py:
CACHES = {
'default': {
'BACKEND':
You're right! I mistake with python object logic :/ Sorry !
Thank's !
Le jeudi 7 novembre 2013 14:45:45 UTC+1, Simone Federici a écrit :
>
>
> On Thu, Nov 7, 2013 at 11:54 AM, Bastien Sevajol
> > wrote:
>
>> formsets = {}
>
>
> this class variable is in
On Thu, Nov 7, 2013 at 11:54 AM, Bastien Sevajol
wrote:
> formsets = {}
this class variable is in ModelFormsetManager class namespace
so it is shared across the subclasses.
You are using formsets to save before the object class, and after the
instances,
so when in
Hello, i don't know if it's a django or python problem. But i correct a
strange bug and would know why my code was bugging and if it was django,
python, or me. The situation (and solution) is exposed
here<http://stackoverflow.com/questions/19818685/django-cache-make-some-mistake-with-form
I love and recommend Redis.
If you can use a Redis key instead of Django's cache, you can call get() on
the key. If the result is not None, now you have it. If it is None, you
know it didn't exist, so you can set it.
I don't think it's possible to have it work the way you want with the
default
I want to do an atomic "test and set if doesn't exist" on a cache key using the
django API. So far, that's easy.; cache.add() gives me exactly that.
But, if the key does exist, I also want to get the current value. All add()
gives me back is a flag saying if the key existed. Is there a way
How does one configure this? The documentation only explains how to use
locmem or memcached, and yet the commit logs reference Redis multiple
times, so it must be doable. Does anybody have any advice or experience
with this?
--
You received this message because you are subscribed to the
On Wed, Oct 26, 2011 at 11:29 PM, dmitry b wrote:
> Can I do check-and-set operations using Django's cache api?
>
>
> Thanks
> D.
>
Memcached reuse existing terminology and then complain that this
causes confusion. Their CAS stands for 'compare and set', rather than
the
Yes, get followed by set can lead to data loss.
What you want is cache.add(). This sets the value if and only if there is no
existing value. Its atomic on backends that support it - notably memcached.
Sent from my iPhone, please excuse any typos
On 27 Oct 2011, at 07:26, Dan Julius
Couldn't that potentially overwrite a value set by a different thread?
Dan
On Thu, Oct 27, 2011 at 7:13 AM, Kurtis Mullins wrote:
> umm, I'm not sure if "check-and-set" is some cache-specific lingo or not.
> But if you want to see if a value isn't set, check to see if
umm, I'm not sure if "check-and-set" is some cache-specific lingo or not.
But if you want to see if a value isn't set, check to see if it's None
type... example:
if cache.get('key') is None:
cache.set('key', 'value', cache_seconds)
Sorry if that's not at all what you're talking about :)
On
Can I do check-and-set operations using Django's cache api?
Thanks
D.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
why are you willing to use the db-cache-backend instead of memcache?
>reply to message:
>date: 11.08.2011 05:02:10
>from: "vsnu" <rsvishnuvar...@gmail.com>
>to: "Django users" <django-users@googlegroups.com>
>subject: [] Django cache separate data
In my django app, I am using a separate database (not default). And I
am selecting it manually by using (using= "database_name")
Now I need to use the django backend cache on that database. For that
straight forward approach works only for default database. For a
separate database, do we need to
I use per-site cache. In my admin actions I want to add some commnad to
clear cache every time content is changed.
How can I clear per-site cache from admin?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web
Looks like you don't really use memcached backend or your memcached
daemon is down.
--
Tomasz Zielinski
pyconsultant.eu
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To
I just tested with the filecache as well, same problem.
On Feb 23, 7:47 pm, dcoy <mt02c...@gmail.com> wrote:
> Hi,
> I have problems using the django cache. The cached items are not
> readable between processes it seems... ?
>
> Testing on the production server using two ssh
Hi,
I have problems using the django cache. The cached items are not
readable between processes it seems... ?
Testing on the production server using two ssh sessions in parallel,
and setting the cache in one and reading in the other using the
memcache backend.
I ran them each one line at a time
On Sat, Jan 29, 2011 at 9:30 PM, Rob Hudson wrote:
> This sounds similar to this bug :
> http://code.djangoproject.com/ticket/15149
If the OP is using Django 1.2.3, this probably isn't #15179 -- Jeff
reports that if he rolls back to before the recent key prefixing
changes, his
This sounds similar to this bug :
http://code.djangoproject.com/ticket/15149
On Jan 28, 8:02 am, Lance Vick wrote:
> So I have a function that sets cache (and successfully outputs it):
>
> def push_cache:
> cache.set('foo_cache', 'FUBAR!!!')
> foodata =
So I have a function that sets cache (and successfully outputs it):
def push_cache:
cache.set('foo_cache', 'FUBAR!!!')
foodata = cache.get('foo_cache')
print(foodata) # this works
However when I try to access that cache from within a view and
directly output it it returns None:
def
On Fri, Nov 12, 2010 at 2:22 PM, Mathieu Leduc-Hamel wrote:
> Hi all,
>
> I'm working on a e-commerce website and to make it work better we've
> implemented a couple of caching strategy. But i was wondering, in our
> system, we are using the cache middleware and the decorator
On Nov 12, 2:22 pm, Mathieu Leduc-Hamel wrote:
> Hi all,
>
> I'm working on a e-commerce website and to make it work better we've
> implemented a couple of caching strategy. But i was wondering, in our
> system, we are using the cache middleware and the decorator to mark
>
Hi all,
I'm working on a e-commerce website and to make it work better we've
implemented a couple of caching strategy. But i was wondering, in our
system, we are using the cache middleware and the decorator to mark
some views as cacheable.
But, loading multiple times the same view, it seems
why dont you use localurl
http://code.google.com/p/django-localeurl/
so you have the language automatically in the URL and you do not need to
change anything...
--
Hinnack
2010/1/14 vitor torres
> Hi. I'm building blog and I want to cache the main page wich is a
>
Hi. I'm building blog and I want to cache the main page wich is a
archive_index generic view and I want to be able to choose between
languages wich means that I must do different cache depending on the
language. So I tried to use the the decorator @vary_on_headers('Accept-
language') in my urls.py
Is there any way to get Django to support write-through caching of
objects?
For example say I have a blog object and I want to retrieve the
attribute "body". Normally the ORM would generate a SQL query and get
the data from the database. Is it possible to set it up so that the
ORM would try the
If you mean fastcgi, it really depends on how you configure it.
If you want a way that guarantees a single process, then use mod_wsgi
and its daemon mode, ensuring you configure it to delegate Django to
one daemon process.
Graham
On Jul 2, 4:04 pm, Hongyu Li wrote:
> what
what about run django on lighttpd, ls it a multi process server too, or ?
On Thu, Jul 2, 2009 at 11:55 AM, Graham Dumpleton <
graham.dumple...@gmail.com> wrote:
>
> Presumably use memcache.
>
> On Jul 2, 12:09 pm, Hongyu Li wrote:
> > Thanks for your comment.
> > What was
On Jul 2, 2:00 pm, Chhouk Voeun wrote:
> no i use window
If this reply was truly about original caching issues with
multiprocess Apache, take note that it was said that it was a UNIX
platform issue. On Windows there is only one process, so it is not a
problem and you can
no i use window
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
Presumably use memcache.
On Jul 2, 12:09 pm, Hongyu Li wrote:
> Thanks for your comment.
> What was you do when want add a global memory cache in your app with django?
>
> On Wed, Jul 1, 2009 at 8:08 PM, Graham Dumpleton
>
>
>
>
> > wrote:
>
>
Thanks for your comment.
What was you do when want add a global memory cache in your app with django?
On Wed, Jul 1, 2009 at 8:08 PM, Graham Dumpleton wrote:
>
>
>
> On Jul 1, 7:22 pm, Hongyu Li wrote:
> > #!/usr/bin/env python
> > # -*-
On Jul 1, 7:22 pm, Hongyu Li wrote:
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> import xmlrpclib
> import os
> import sys
> import time
> import math
> import optparse
> import tm.filecheck
> import service
> from django.http import HttpResponse
> from
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xmlrpclib
import os
import sys
import time
import math
import optparse
import tm.filecheck
import service
from django.http import HttpResponse
from django.core.cache import cache
def getCategoryAndDetail(request):
keyword =
On May 15, 4:14 am, online wrote:
> Thanks, this kind of design is interesting, not what i expected
> though.
>
> I thought the server is running whatever my script i want to use
> return render_to_response('home.html')
> or
> return
Restart your apache every once and a while, if you want to see latest
changes.
Alan.
On May 15, 6:14 am, online wrote:
> Thanks, this kind of design is interesting, not what i expected
> though.
>
> I thought the server is running whatever my script i want to use
Thanks, this kind of design is interesting, not what i expected
though.
I thought the server is running whatever my script i want to use
return render_to_response('home.html')
or
return render_to_response('index.html')
On May 14, 7:55 pm, David Zhou wrote:
> On Thu,
On Thu, May 14, 2009 at 9:53 PM, online wrote:
>
> Whatever i changed 'home.html' to other page i always get the same
> result.
Are you restarting your serving? If by "changed home.html to other
page" you mean you modified your view function to return a different
On Thu, May 14, 2009 at 6:53 PM, online wrote:
>
> This is my code
>
>
> from django.http import HttpResponse
> from django.template import Context, loader
> from django.shortcuts import render_to_response
> from django.views.decorators.cache import cache_control
>
This is my code
from django.http import HttpResponse
from django.template import Context, loader
from django.shortcuts import render_to_response
from django.views.decorators.cache import cache_control
@cache_control(no_cache=True)
def index(request):
#t =
Are you sure it isn't your browser? have you tried testing your
concern with curl?
On May 14, 12:19 pm, online wrote:
> Hi all,
>
> I have a small project still under development. I don't set any cache
> stuff yet. But for somehow django still cache all web pages.
On May 14, 8:19 pm, online wrote:
> Hi all,
>
> I have a small project still under development. I don't set any cache
> stuff yet. But for somehow django still cache all web pages.
>
> Why django default uses cache? How can i disable the all level
> caches?
>
> I
Hi all,
I have a small project still under development. I don't set any cache
stuff yet. But for somehow django still cache all web pages.
Why django default uses cache? How can i disable the all level
caches?
I tried
from django.views.decorators.cache import cache_control
Daehee wrote:
> i'm trying it figure out why django is not recognizing a new models.py
> file for my app. even when i completely butcher the code in models.py
> or change the filename and run "manage.py sqlreset" or "manage.py
> syndb," it still generates the old model. any thoughts??
manage.py
On Tue, Jul 8, 2008 at 6:12 PM, Daehee <[EMAIL PROTECTED]> wrote:
>
> i'm trying it figure out why django is not recognizing a new models.py
> file for my app. even when i completely butcher the code in models.py
> or change the filename and run "manage.py sqlreset" or "manage.py
> syndb," it
i'm trying it figure out why django is not recognizing a new models.py
file for my app. even when i completely butcher the code in models.py
or change the filename and run "manage.py sqlreset" or "manage.py
syndb," it still generates the old model. any thoughts??
HI all,
I have a django site on dreamhost. It runs well before. As table records
grew, I introduced low level cache about queryset as document said.
Something like this:
if not cache.get(key):
try:
r = Book.objects.all().order_by('-modify_date')
except
On 2/25/07, Jaanus <[EMAIL PROTECTED]> wrote:
> API, from where the web side of things can pick it up? 1) will it work
> (of course I'll also try out myself, but I thought I'd consult a bit
> first) and 2) is it a nice/"right" way of doing things? maybe I should
> look at some other architectural
Hi,
aplogies if this is a FAQ/recently discussed - I tried a quick search
but didn't find anything - hit me with a URL if there is one.
My question - does Django cache work across scripts? The problem I
have is: my page needs to show some data that is timewise expensive to
generate. If I do
You might want to look into a caching reverse proxy. You can setup
Squid in that configuration:
http://wiki.squid-cache.org/SquidFaq/ReverseProxy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
65 matches
Mail list logo