Django cache template

2022-02-02 Thread Dev femibadmus
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: > >

Reading the timeout value for a django cache entry (for testing)

2019-11-11 Thread guettli
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:

Fwd: FW: Byte string error Django cache + celery

2019-08-20 Thread Kai Aeberli
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

Backend for django-cache using dynamodb

2018-11-14 Thread Ezequiel Bertti
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

Using Redis as Django Cache

2017-04-05 Thread Luvpreet Singh
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 :

Re: Unable to parse connection string: "" when using django cache

2016-03-20 Thread Nandakumar Chandrasekhar
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

Re: Unable to parse connection string: "" when using django cache

2016-03-19 Thread jorrit787
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.

Re: Unable to parse connection string: "" when using django cache

2016-03-11 Thread nav
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 >

Re: Unable to parse connection string: "" when using django cache

2016-03-10 Thread Nandakumar Chandrasekhar
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)

Unable to parse connection string: "" when using django cache

2016-03-10 Thread nav
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 =

Re: django-cache-machine with Redis

2014-04-24 Thread Ramón Carrillo
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

Re: django-cache-machine with Redis

2014-04-24 Thread Mike Megally
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

Re: django-cache-machine with Redis

2014-04-24 Thread Ramón Carrillo
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,

Re: django-cache-machine with Redis

2014-04-23 Thread Mike Megally
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

Django cache framework with apache and mod_wsgi

2013-11-17 Thread Gabriel-Cristian Muj
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':

Re: Django (cache?) make some mistake with formset generated class

2013-11-07 Thread Bastien Sevajol
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

Re: Django (cache?) make some mistake with formset generated class

2013-11-07 Thread Simone Federici
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

Django (cache?) make some mistake with formset generated class

2013-11-07 Thread Bastien Sevajol
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

Re: Atomic test/set/get using django cache API?

2013-05-14 Thread Shawn Milochik
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

Atomic test/set/get using django cache API?

2013-05-14 Thread Roy Smith
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

django-cache-machine with Redis

2013-03-28 Thread Alan Johnson
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

Re: CAS and Django cache

2011-10-27 Thread Tom Evans
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

Re: CAS and Django cache

2011-10-27 Thread Malcolm Box
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

Re: CAS and Django cache

2011-10-27 Thread 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

Re: CAS and Django cache

2011-10-26 Thread Kurtis Mullins
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

CAS and Django cache

2011-10-26 Thread dmitry b
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

RE: [] Django cache separate database

2011-08-11 Thread Henrik Genssen
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

Django cache separate database

2011-08-11 Thread vsnu
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

Django Cache - how to clear per-site cache?

2011-07-13 Thread galgal
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

Re: django cache (memcache) items are not readable between processes

2011-02-26 Thread Tomasz Zieliński
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

Re: django cache (memcache) items are not readable between processes

2011-02-23 Thread dcoy
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

django cache (memcache) items are not readable between processes

2011-02-23 Thread dcoy
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

Re: Django cache created in one function not available to another?

2011-01-29 Thread Russell Keith-Magee
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

Re: Django cache created in one function not available to another?

2011-01-29 Thread Rob Hudson
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 =

Django cache created in one function not available to another?

2011-01-28 Thread Lance Vick
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

Re: Django cache view

2010-11-12 Thread Tom Evans
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

Re: Django cache view

2010-11-12 Thread Daniel Roseman
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 >

Django cache view

2010-11-12 Thread Mathieu Leduc-Hamel
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

Re: Django Cache

2010-01-14 Thread Hinnack
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 >

Django Cache

2010-01-14 Thread vitor torres
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

Using Django cache framework for object write-through caching?

2009-09-04 Thread Continuation
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

Re: django cache framework not work well on mod_python of apache

2009-07-02 Thread Graham Dumpleton
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

Re: django cache framework not work well on mod_python of apache

2009-07-02 Thread Hongyu Li
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

Re: django cache framework not work well on mod_python of apache

2009-07-01 Thread Graham Dumpleton
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

Re: django cache framework not work well on mod_python of apache

2009-07-01 Thread Chhouk Voeun
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

Re: django cache framework not work well on mod_python of apache

2009-07-01 Thread Graham Dumpleton
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: > >

Re: django cache framework not work well on mod_python of apache

2009-07-01 Thread Hongyu Li
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 > > # -*-

Re: django cache framework not work well on mod_python of apache

2009-07-01 Thread Graham Dumpleton
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

django cache framework not work well on mod_python of apache

2009-07-01 Thread Hongyu Li
#!/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 =

Re: disable django cache

2009-05-15 Thread Daniel Roseman
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

Re: disable django cache

2009-05-15 Thread zayatzz
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

Re: disable django cache

2009-05-14 Thread online
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,

Re: disable django cache

2009-05-14 Thread David Zhou
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

Re: disable django cache

2009-05-14 Thread Colin Bean
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 >

Re: disable django cache

2009-05-14 Thread online
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 =

Re: disable django cache

2009-05-14 Thread John M
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.

Re: disable django cache

2009-05-14 Thread Daniel Roseman
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

disable django cache

2009-05-14 Thread online
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

Re: does django cache models.py?

2008-07-09 Thread Norman Harman
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

Re: does django cache models.py?

2008-07-08 Thread Milan Andric
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

does django cache models.py?

2008-07-08 Thread Daehee
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??

django cache size limited?

2008-05-28 Thread book4e
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

Re: does Django cache work across scripts?

2007-02-25 Thread James Bennett
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

does Django cache work across scripts?

2007-02-25 Thread Jaanus
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

Re: Static, non-django cache combined with django?

2006-10-08 Thread RajeshD
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"