title: create custom decorator in django based on url paramenters
body: <p>I have two login urls: </p>
  
  <ol>
  <li>/profile/login/</li>
  <li>/mob/profile/login/</li>
  </ol>
  
  <p>And I have a view,</p>
  
  <pre><code>@login_required
  def favorited_spreads(request ,page_template='spreads/favorited_spreads_ajax.html',
          template='spreads/favorited_spreads.html',mode=None):
      profile = request.user.profiles
      spreads = profile.favorite_by.all()
      context = {
              'spreads': spreads,
              'profile': profile,
          }
      if request.is_ajax():
          template=page_template
      return render(request, template,context)
  </code></pre>
  
  <p>And my two urls are:</p>
  
  <pre><code> url(r'^favorites/$',
      'favorited_spreads', name='favorited_spreads'),
  url(r'^mob/favorites/$',
          'favorited_spreads',{
                 'template':'mobapps/spreads/favorited_spreads.html',"mode":"mob"}, name='favorited_spreads_mob'),
  </code></pre>
  
  <p>Now my question is, I want a decorator instead of <code>@login_required</code> say <code>@custom_login_required</code>, in which if the user is not authenticated and going to url <code>/favorites/ here mode=None</code>, it should be redirected to url <code>/profile/login/</code>. </p>
  
  <p>And if he is going to url <code>/mob/favorites/</code> (here mode='mob')with out authentication he should be redirected to login url <code>/mob/profile/login/</code>.</p>
  
  <p>Any help is highly appreciated. If the question not clear please comment. </p>