by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Bertrand Bordage
    @BertrandBordage
    if it’s negligible, then I strongly advice you don’t use it
    to measure boost, compare the difference in page response time using production settings, because DEBUG has a huge impact on performance, especially if you use django-debug-toolbar with the SQL panel enabled
    Ryan Bales
    @thinkt4nk
    hello, I've looked through the documentation, but I haven't found any mention of support of invalidating a cache and limiting it to a key prefix. Is the key prefix "baked-in" to the cache that I invalidate, or is this just not supported?
    Toon Gijbels
    @toongijbels
    Hi, is it possible to use cachalot as a low-level cache as the standard django cache? I would like to store querysets and objects in it without caching the view.
    selimt
    @selimt
    @BertrandBordage what is the plan for fixing Django 2.0 compatibility issues? We can not move to it until then.
    Bertrand Bordage
    @BertrandBordage
    @toongijbels: django-cachalot uses the low-level cache of Django. You cannot replace the low-level cache of Django with django-cachalot, since django-cachalot is not a cache backend. I’m not sure what you mean by the second part of your question, please answer again more clearly.
    @selimt: I’ll issue a new version soon that will support Django 2.0 and drop support for Python 2 & Django < 2. Unfortunately, I have very little time at the moment, as I’m pretty busy with my own business as well as with Wagtail 2.0, one of the most important release so far.
    Bertrand Bordage
    @BertrandBordage
    No Estimated Time of Arrival for now, unless someone is willing to sponsor it.
    selimt
    @selimt
    @BertrandBordage thanks, we'll stick with 1.11 for now.
    Kosei Kitahara
    @Surgo
    @BertrandBordage I want to contribute to support django2.0.
    But before support it, drop support for EOL versions.
    PR for drop it :)
    https://github.com/BertrandBordage/django-cachalot/pull/102/files
    Thank you.
    Bertrand Bordage
    @BertrandBordage
    Thanks @Surgo! I’ll review it and try to issue a new 2.0 version by the end of next week :) I need it to migrate one of my projects, so you can be sure it will not be delayed any longer.
    Kosei Kitahara
    @Surgo
    Wow! Great news :smile:
    Good luck with your projects!
    Bertrand Bordage
    @BertrandBordage
    thanks! You may have noticed I work a lot on Wagtail since late 2016 (I even made a Kickstarter last month), that’s why I have little time for django-cachalot recently
    Kosei Kitahara
    @Surgo
    :tada: 2.0.0
    @BertrandBordage Thank you so much :)
    Bertrand Bordage
    @BertrandBordage
    You’re welcome @Surgo ;)
    Charles Soetan
    @casoetan
    Hey all.
    Is it possible to specify table names as wildcards in the CACHALOT_ONLY_CACHABLE_TABLES settings?
    something like notifications*
    Bertrand Bordage
    @BertrandBordage
    hey Charles!
    Not possible at the moment
    Charles Soetan
    @casoetan
    Ok. Any plans for this in the future?
    Bertrand Bordage
    @BertrandBordage
    no, and unless there is a strong demand, it’s unlikely to ever go into django-cachalot
    so you have to manually write all the tables you want to include
    Charles Soetan
    @casoetan
    Ok. Thanks
    Robert Sköld
    @slaskis
    hey @BertrandBordage I was never able to run the tests locally, which is why i tried it on travis :) are there some instructions that i missed on how to setup an environment for testing?
    Bertrand Bordage
    @BertrandBordage
    Hi @slaskis, the test suite is indeed pretty heavy since it requires you to setup SQLite, MySQL, PostgreSQL, Memcached & Redis
    there are no instructions apart from running runtests.py
    and adjust the DB & cache settings in settings.py
    Claudio J. Cáceres
    @claudiokc
    Greetings from Honduras.... Trying django-cachalot today! Thank you for all the effort
    Bertrand Bordage
    @BertrandBordage
    Hey @claudiokc, tell us if you see an interesting difference with django-cachalot enabled :)
    Ken Zhang
    @kennir
    Hi all, django-cachalot is not compatible with django-taggit , any idea?
    _find_subqueries_in_where can not process ExtraJoinRestriction of taggit
    Вячеслав Жадеев
    @vzhadeyev_twitter
    Hi, today redis-py got a major update. It causes problems when using django-redis as caching backend(niwinz/django-redis#342). So terrible to realize it when deploying to production =)
    Utkarsh Bansal
    @utkbansal

    Hi, I am trying to setup cachalot. I can't seem to get the CACHALOT_ONLY_CACHABLE_TABLES setting to work. Without the CACHALOT_ONLY_CACHABLE_TABLES setting, the cache is working (I can verify that using debug toolbar and there are GET and SET calls in memcached). When I set CACHALOT_ONLY_CACHABLE_TABLES to a tuple of table names

    CACHALOT_ONLY_CACHABLE_TABLES = (
        'backend_userprofile',
        'auth_user'
        'knox_authtoken',
        'constance_config'
    )

    it stops working - all queries hit MySQL and there is no activity in memcached. Any ideas why this might be happening?

    CACHALOT_TIMEOUT = 10 * 60  # 10 minutes
    
    CACHALOT_ONLY_CACHABLE_TABLES = (
        'backend_userprofile',
        'auth_user'
        'knox_authtoken',
        'constance_config'
    )
    
    CACHALOT_ENABLED = True
    CACHALOT_CACHE = 'memcached'
    
    MEMCACHE_SERVER = 'localhost:11211'
    
    CACHES['memcached'] = {  # noqa F821
        'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
        'LOCATION': MEMCACHE_SERVER,
        'OPTIONS': {
            'binary': False,
        }
    
    }

    I am using django-cachalot==2.1.0 with memcached 1.5.4 and mysql 5.7.21

    Utkarsh Bansal
    @utkbansal
    It works if I set
    CACHALOT_ONLY_CACHABLE_TABLES = (
        'backend_userprofile',
        'auth_user'
        #'knox_authtoken',
        #'constance_config'
    )
    Mike Bjerkness
    @mbjerkness

    I am getting the following error when using from psycopg2 import sql to create a query.

    Applying contacts.0025_migrate_old_responses...Traceback (most recent call last):
    File "manage.py", line 23, in <module>
      execute_from_command_line(sys.argv)
    File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
      utility.execute()
    File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
      output = self.handle(*args, **options)
    File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 200, in handle
      fake_initial=fake_initial,
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
      state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
      state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
      state = migration.apply(state, schema_editor)
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/migration.py", line 122, in apply
      operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
    File "/usr/local/lib/python3.6/site-packages/django/db/migrations/operations/special.py", line 190, in database_forwards
      self.code(from_state.apps, schema_editor)
    File "/opt/centriam/cx/cx-api/contacts/migrations/0025_migrate_old_responses.py", line 19, in migrate_old_responses
      cur.execute(query)
    File "/usr/local/lib/python3.6/site-packages/raven/contrib/django/client.py", line 127, in execute
      return real_execute(self, sql, params)
    File "/usr/local/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 130, in inner
      sql = sql.lower()
    cx-api-test_1              | AttributeError: 'Composed' object has no attribute 'lower'

    when running the following query. Any ideas?

    
    template = sql.SQL("SELECT DISTINCT * FROM {table_name}"
    
    )
    with connection.cursor() as cur:
        query = template.format(
            table_name=sql.Identifier('table_name'),
        )
        cur.execute(query)
    Allan Nava
    @Allan-Nava
    Is possible to customize django cachalot to specific models?
    x-7
    @x-7
    when i call many_to_many manager remove function,cachalot not invalidate cache
    Gabrielle Trotter
    @gmagee101
    Hey - just getting started with cachalot here - is there a trick to getting it working with unit tests? for example maybe disable the plugin for unit tests? Many of my tests are failing with this or similar stack trace:
      File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert
        return query.get_compiler(using=using).execute_sql(return_id)
      File "/usr/local/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 32, in inner
        return original(compiler, *args, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 99, in inner
        cache_alias=cachalot_settings.CACHALOT_CACHE)
      File "/usr/local/lib/python3.6/site-packages/cachalot/api.py", line 76, in invalidate
        list(_get_tables(tables_or_models)), cache_alias, db_alias):
      File "/usr/local/lib/python3.6/site-packages/cachalot/api.py", line 36, in _get_tables
        table_or_model = apps.get_model(table_or_model)
      File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 200, in get_model
        app_label, model_name = app_label.split('.')
    ValueError: too many values to unpack (expected 2)
    John Kelly
    @john-kelly

    hello all. does anyone have a good ballpark number re: when cachalot should not be used on a given table? the docs mentions something about 50 modifications per second in one place, however, says 50 modifications per minute in another.

    i acknowledge this is specific to my application and corresponding traffic, however, i'm looking for strategies to help diagnose things.

    with that being said, thanks for this wonderful project!

    John Kelly
    @john-kelly

    for context:

    https://django-cachalot.readthedocs.io/en/latest/introduction.html#should-you-use-it

    However, it’s not suited for projects where there is a high number of modifications per minute on each table, like a social network with more than a 50 messages per minute.

    https://django-cachalot.readthedocs.io/en/latest/limits.html

    Do not use django-cachalot if your project has more than 50 database modifications per second on most of its tables.

    John Kelly
    @john-kelly
    @BertrandBordage (tagging you for visibility, hopefully that's okay)
    Michael Bunsen
    @mihow
    Is it possible to use a custom database backend with django-cachalot? I have one that extends django.db.backends.mysql. I don't see a way to modify the SUPPORTED_DATABASE_ENGINES setting.
    ritiko
    @ritiko
    any idea what's holding back support for django 2.2? Happy to help to push it out if needed
    ierosodin
    @ierosodin
    I'm wondering whether if Cachalot will cache the database object in the following two api:
    Entry.objects.filter(***).values_list()
    list(Entry.objects.filter(***))
    babylonlin
    @babylonlin
    I am using django import export for importing data. I am wondering how Cachalot works in case of importing data. Since django import export fetch object from database for each importing row for comparing differences, will Cachalot slow down the import process? Anyone got experiences with it? If so How can I disable Cachalot in coding for certain method?
    Ryan Bales
    @thinkt4nk
    readme now says that the maintainer is no longer using this package. What is the maintainer using as an alternative?
    Andrew Chen Wang
    @Andrew-Chen-Wang
    Hey guys! I'm a new maintainer for Django-cachalot. I'll work on fixing the two branches around Django 2.2 and 3 asap.