title: How to use django template tag 'url' with django 1.6?
body: <p>I'm using Python 2.7.5, django 1.6.2 and bootstrap 3.</p>
  
  <p>I know the template tag <code>{% url %}</code> changed since django 1.5. I've read the <a href="https://docs.djangoproject.com/en/1.6/topics/http/urls/#reverse-resolution-of-urls" rel="nofollow">documentation for reverse url</a> on django website but I must do something wrong because I can't get it to work.</p>
  
  <p>Here is my teams/urls.py, I use the named url <code>delete_team_url</code> :</p>
  
  <pre><code>from django.conf.urls import patterns, url
  import teams.views
  
  urlpatterns = patterns('',
      url(r'^$', teams.views.index, name='teams_index'),
      url(r'^new-team/$', teams.views.index, {'add_new_team':True}, name='teams_index_new_team'),
      url(r'^delete/$', teams.views.delete_team, name='delete_team_url'), 
  
  )
  </code></pre>
  
  <p>Here is the project global urls.py :</p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from django.contrib import admin
  
  import bbch.views
  import auth.views
  admin.autodiscover()
  
  urlpatterns = patterns('',
      url(r'^admin/', include(admin.site.urls)),
      url(r'^rosetta/', include('rosetta.urls')),
      url(r'^i18n/', include('django.conf.urls.i18n')),
  
      url(r'^auth/', include('auth.urls', namespace="auth")),
      url(r'^rules/', include('rules.urls', namespace="rules")),
      url(r'^forum/', include('forum.urls', namespace="forum")),
      url(r'^teams/', include('teams.urls', namespace="teams")),
  
      url(r'^accounts/login/$', auth.views.connection, {'log_required':True}),
      url(r'^home/log_in/$', bbch.views.home, {'log_message':True}, name="home_log_message"),
      url(r'^home/$', bbch.views.home, name="bbch"),
      url(r'^$',  bbch.views.home, name="bbch"),
  
  )
  </code></pre>
  
  <p>Here is my view (I'm using dummy <code>id=0</code> just for the test) :</p>
  
  <pre><code>def delete_team(request):
      team = teams.models.Team.objects.get(id=0)
      team.delete()
  
      return render(request, 'teams/index.html', context)
  </code></pre>
  
  <p>And finally here is my html code part where I use the reverse url template tag :</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-2"&gt;
          &lt;a href="{% url 'delete_team_url' %}" class="btn btn-danger delete-team"&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt; {% trans "Delete team" %}&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="col-md-2"&gt;
          &lt;a href="#" class="btn btn-info edit-team"&gt;&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt; {% trans "Edit team" %}&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="col-md-2 col-md-offset-6 btn-right"&gt;
          &lt;a href="#" class="btn btn-success add-player"&gt;&lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; {% trans "Add a player" %}&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I get the following error :</p>
  
  <pre><code>NoReverseMatch at /teams/
  Reverse for 'delete_team_url' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
  </code></pre>
  
  <p>Let me know if you need more informations ! Thank you for your help !</p>
  
  <hr>
  
  <p>Edit : Here is the <code>teams.views.index</code> (asked by weasel) :</p>
  
  <pre><code>@login_required
  def index(request, add_new_team=False) :
      if request.method == 'POST' :
  
          t_form = teams.forms.CreateTeamForm(request.POST)
          p_form = teams.forms.CreatePlayerForm(request.POST)
          t_errors = t_form.errors
          p_errors = p_form.errors
  
          if t_form.is_valid() :
              create_new_team = t_form.cleaned_data['new_team']
          else : 
              create_new_team = False
  
          if p_form.is_valid() :
              add_player = p_form.cleaned_data['new_player']
          else :
              add_player  = False
          #import ipdb; ipdb.set_trace()
          if create_new_team :
              if t_form.is_valid() :
  
                  name = t_form.cleaned_data['name']
                  reroll = t_form.cleaned_data['reroll']
                  apo = t_form.cleaned_data['apo']
                  assistant = t_form.cleaned_data['assistant']
                  pompom = t_form.cleaned_data['pompom']
                  pop = t_form.cleaned_data['pop']
                  value = t_form.cleaned_data['value']
                  treasury = t_form.cleaned_data['treasury']
  
                  team = teams.models.Team(
                      name=name,
                      coach=request.user.username,
                      reroll=reroll,
                      apo=apo,
                      assistant=assistant,
                      pompom=pompom,
                      pop=pop,
                      value=value,
                      treasury=treasury,
                      )
                  team.save()
  
                  team_set = teams.models.Team.objects.filter(coach=request.user.username)
                  player_form = teams.forms.CreatePlayerForm()
                  context = {
                      'create_player_form' : player_form,
                      'teams' : team_set,
                      'username' : request.user,
                      'loged_in' : request.user.is_authenticated(),
                  }
                  return render(request, 'teams/index.html', context)
  
          elif add_player :
              if p_form.is_valid() :
  
                  name = p_form.cleaned_data['name']
                  position = p_form.cleaned_data['position']
                  number = p_form.cleaned_data['number']
                  team_id = request.POST.get('team_id')
                  team = teams.models.Team.objects.get(coach=request.user.username, id=team_id)
  
                  team.player_set.create(name=name, position=position, number=number)
                  team.size = team.player_set.count()
                  team.save()
  
                  team_set = teams.models.Team.objects.filter(coach=request.user.username)
                  player_form = teams.forms.CreatePlayerForm()
                  context = {
                      'tab_id': team.id,
                      'create_player_form' : player_form,
                      'teams' : team_set,
                      'username' : request.user,
                      'loged_in' : request.user.is_authenticated(),
                  }
                  return render(request, 'teams/index.html', context)
  
          else :
              team_set = teams.models.Team.objects.filter(coach=request.user.username)
              team_form = teams.forms.CreateTeamForm()
              player_form = teams.forms.CreatePlayerForm()
  
              context = {
              'create_player_form' : player_form,
              'create_team_form' : team_form,
              'alert_form_player' : p_errors,
              'alert_form_team' : t_errors,
              'teams' : team_set,
              'username' : request.user,
              'loged_in' : request.user.is_authenticated(),
              }
  
              return render(request, 'teams/index.html', context)
  
      elif request.method == 'GET' :
          team_set = teams.models.Team.objects.filter(coach=request.user.username)
          team_form = teams.forms.CreateTeamForm()
          player_form = teams.forms.CreatePlayerForm()
  
          context = {
              'add_new_team': add_new_team,
              'create_player_form' : player_form,
              'create_team_form' : team_form,
              'teams' : team_set,
              'username' : request.user,
              'loged_in' : request.user.is_authenticated(),
          }
  
          return render(request, 'teams/index.html', context)
  </code></pre>