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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -