django flag for mobile request? -


I have to be a flag variable to test the mobile page in the digengo.

We currently need it to use the flag on both Dragon View, Django templates, Javascript, handler templates.

Something like this might be done, like something like {% if_testing_mobile%}. {% Endif%}

We only provide some pages for mobile and PC To distribute separately. (Most pages are covered by bootstrap fluid)

How can we set a variable to switch / switch on mobile?

Try it,

 import  mobile_detect_mobile def my_mobile_view (Requested): is_mobile = if request.mobile: is_mobile = true #with some mobile render (request, 'page html', {'is_mobile': is_mobile})   

Page.html:

  {% if_mobile%} presents mobile CSS {% else%} then PC CSS {% endif%}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -