Coder Social home page Coder Social logo

Comments (7)

gregmuellegger avatar gregmuellegger commented on August 16, 2024

A cookie is only set when you force a flavour. In which situation do you expect a cookie to be set, can you post the actual response headers that should set the cookie but didn't?

from django-mobile.

bung87 avatar bung87 commented on August 16, 2024

I would like to store the flavour at user's browser,then detemine initial page size of api results.

from django-mobile.

gregmuellegger avatar gregmuellegger commented on August 16, 2024

Like I said, the cookie will be set the first time when the ?flavour=... GET parameter is used.
You can read the currently active flavour with django_mobile.get_flavour

from django-mobile.

bung87 avatar bung87 commented on August 16, 2024

oh,I just thought it will be set when detected the flavour,if I use get_flavour multi-time,It may becoming inefficient

from django-mobile.

gregmuellegger avatar gregmuellegger commented on August 16, 2024

Why would you think that, the implementation is really simple: https://github.com/gregmuellegger/django-mobile/blob/master/django_mobile/__init__.py#L78

from django-mobile.

bung87 avatar bung87 commented on August 16, 2024

looks really simple! If I set the store_backend to cookie,and ?flavour=... not presented ,it will looks into request object then _local variable which stores flavour in threading.local(),thank god,First time heard of threading.local(),Thank your for answerd my question.

from django-mobile.

gregmuellegger avatar gregmuellegger commented on August 16, 2024

:) Have fun using it.

from django-mobile.

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.