Code Monkey home page Code Monkey logo

Comments (9)

keybits avatar keybits commented on May 9, 2024

I have the same issue. Any suggestions gratefully received.

from cookiecutter-django.

keybits avatar keybits commented on May 9, 2024

I've fixed this now.

First add django-pylibmc-sasl==0.2.4 to requirements.txt.

Then in settings.py replace the "CACHING" section at the end of the file with:

    ########## CACHING
    # Only do this here because thanks to django-pylibmc-sasl and pylibmc memcacheify is painful to install on windows.

    os.environ['MEMCACHE_SERVERS'] = os.environ.get('MEMCACHIER_SERVERS', '')
    os.environ['MEMCACHE_USERNAME'] = os.environ.get('MEMCACHIER_USERNAME', '')
    os.environ['MEMCACHE_PASSWORD'] = os.environ.get('MEMCACHIER_PASSWORD', '')

    CACHES = {
      'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': os.environ.get('MEMCACHIER_SERVERS', ''),
        'TIMEOUT': 500,
        'BINARY': True,
        'OPTIONS': { 'tcp_nodelay': True }
      }
    }

    ########## END CACHING

It should now work fine on Heroku.

from cookiecutter-django.

pydanny avatar pydanny commented on May 9, 2024

Any reason for not doing this django-configuration style?

from cookiecutter-django.

keybits avatar keybits commented on May 9, 2024

Sorry, no reason. Was just in a rush to get something working!

I'm actually now replacing it with a redis cache since pylibmc isn't Python 3 compatible.

from cookiecutter-django.

keybits avatar keybits commented on May 9, 2024

Hmm - forgot that boto is in this setup. Looks like Python 3 will have to wait a bit longer....

from cookiecutter-django.

theskumar avatar theskumar commented on May 9, 2024

@geeljire @knitatoms https://github.com/rdegges/django-heroku-memcacheify should be able to help you out. It's a one line configuration.

@pydanny if you think it can be included here, I can send a PR! The only issue is you need to install lib-memcached before you can install this.

from cookiecutter-django.

pydanny avatar pydanny commented on May 9, 2024

@theskumar A PR sounds great. Please include documentation on setting up lib-memcached.

from cookiecutter-django.

theskumar avatar theskumar commented on May 9, 2024

@pydanny @geeljire this issue is resolved can we close this please.

from cookiecutter-django.

sardeie avatar sardeie commented on May 9, 2024

Thanks @theskumar. Closing.

from cookiecutter-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.