title: Django user impersonation by admin
body: <p>I have a Django app. When logged in as an admin user, I want to be able to pass a secret parameter in the URL and have the whole site behave as if I were another user.</p>
  
  <p>Let's say I have the URL <code>/my-profile/</code> which shows the currently logged in user's profile. I want to be able to do something like <code>/my-profile/?__user_id=123</code> and have the underlying view believe that I am actually the user with ID 123 (thus render <em>that</em> user's profile).</p>
  
  <p>Why do I want that?</p>
  
  <p>Simply because it's much easier to reproduce certain bugs that only appear in a single user's account.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>What would be the easiest way to implement something like this?</p></li>
  <li><p>Is there any security concern I should have in mind when doing this? Note that I (obviously) only want to have this feature for admin users, and our admin users have full access to the source code, database, etc. anyway, so it's not really a "backdoor"; it just makes it <em>easier</em> to access a user's account.</p></li>
  </ol>