Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango mobile and full site redirects
    primarykey
    data
    text
    <p>I've been searching for a while on Google and haven't been able to find exactly what I'm looking for and decided to ask everyone here.</p> <p>I've got a full site and mobile version of the site (one page jQuery Mobile file). </p> <p>In theory what I would like is to check the incoming request for a possible mobile device (I can already do this) and redirect to the mobile site. On the mobile site the user can click a link to the full site that sets a cookie and won't redirect that user back to the mobile site (even though they will meet that condition with every request with their device).</p> <p>All that I have been able to find is about how to check every request for mobile/desktop device and change the template accordingly. Which isn't what I need to do in this situation. It's a completely different template for the mobile and desktop versions.</p> <p>Any ideas or solutions that may help in this situation?</p> <p>UPDATE 1:</p> <p>So I've tried implementing this and I am having some weird issues/problems. Here is my Middleware (listed last on the Middleware list in the settings)</p> <pre><code>class mobile_check(object): def process_request(self,request): if mobileBrowser(request) and not request.session.get('view_full'): return HttpResponseRedirect(reverse('posts.views.mobile_django')) </code></pre> <p>Here's the view to handle when they click the full site link in jQuery Mobile.</p> <pre><code>def mobile_fullsite(request): #import pdb; pdb.set_trace() request.session['view_full'] = True return HttpResponseRedirect(reverse('posts.views.index')) </code></pre> <p>In my head this should work fine but it doesn't. It hits the mobile_fullsite view from the link and the url changes from .../mobile/ to .../fullsite/ Yet it still looks like jQuery mobile with some stuff from the redirected pages.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload