Git Product home page Git Product logo

django-cbv's People

Contributors

brutasse avatar sorl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chrisglass

django-cbv's Issues

TypeError: can't pickle function objects with per-site cache

From @Kooludo on sorl/django-cbv:

Hi there. I'm getting an error "TypeError: can't pickle function objects" when I attempt to use django-cbv with Django's per site caching middleware (django.middleware.cache.FetchFromCacheMiddleware and django.middleware.cache.UpdateCacheMiddleware).

In my case it seems like it's failing on attempting to pickle an object of type cbv.http.TemplateResponse. I've tried with memcache and locmem backends.

Is this a known issue. Are there any workarounds?

Traceback (most recent call last):

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 280, in run
    self.result = application(self.environ, self.start_response)

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 674, in __call__
    return self.application(environ, start_response)

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 252, in __call__
    response = middleware_method(request, response)

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/site-packages/django/middleware/cache.py", line 105, in process_response
    cache.set(cache_key, response, timeout)

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/site-packages/django/core/cache/backends/locmem.py", line 86, in set
    self._set(key, pickle.dumps(value), timeout)

  File "/home/ludo/.virtualenvs/myproject-env/lib/python2.6/copy_reg.py", line 70, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__

TypeError: can't pickle function objects

It's happening with two different apps using cbv generic views. It's unable to pickle an object of type cbv.http.TemplateResponse.

I'm also using Django-CMS, so wonder if that could be messing with something?

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.