PyAr / pyarweb

El sitio web de Python Argentina
http://python.org.ar
Apache License 2.0
81 stars 99 forks source link

"etiquetas" de noticias crashea con un "?" #194

Closed mgaitan closed 9 years ago

mgaitan commented 9 years ago

puse "que carajo es esto?" y explotó

Environment:

Request Method: GET
Request URL: http://beta.python.org.ar/noticias/1/

Django Version: 1.7.1
Python Version: 3.3.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'community',
 'news',
 'pycompanies',
 'jobs',
 'events',
 'newbie',
 'projects',
 'faq',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'django_extensions',
 'disqus',
 'taggit',
 'taggit_autosuggest',
 'bootstrap3_datetime',
 'planet',
 'pagination',
 'tagging',
 'bootstrap3',
 'django_summernote',
 'sendfile',
 'crispy_forms',
 'email_obfuscator',
 'waliki',
 'waliki.git',
 'waliki.attachments')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'pagination.middleware.PaginationMiddleware')

Template error:
In template /home/www-pyar/pyarweb_beta/pyarweb/templates/news/newsarticle_detail.html, error at line 25
   Reverse for 'news_tags_list' with arguments '()' and keyword arguments '{'tag': 'esto?'}' not found. 1 pattern(s) tried: ['noticias/tag/(?P<tag>[\\w-]+)/$']
   15 :           {{ object.title }}

   16 :           <span class="pull-right">

   17 :             {% if object.owner == user %}

   18 :             <a href="{% url 'news_update' object.id %}" class="btn btn-info">{% trans 'Editar' %}</a>

   19 :             <a href="{% url 'news_delete' object.id %}" class="btn btn-danger">{% trans 'Borrar' %}</a>

   20 :             {% endif %}

   21 :           </span>

   22 :         </h2>

   23 :         <div class="tags">

   24 :           <small>{{ object.created|date:"SHORT_DATE_FORMAT" }} -{# <strong>{{ object.owner }}</strong> #}</small>

   25 :           <p> {% for t in object.tags.all %}<a href=" {% url 'news_tags_list' tag=t.name %} " class="label label-default">{{ t.name }}</a> {% endfor %}</p>

   26 :         </div>

   27 :       </div>

   28 :       <article>

   29 :         <p>{% autoescape off %}{{ object.body|linebreaks|safe }}{% endautoescape %}</p>

   30 :       </article>

   31 :       <div class="row">

   32 :       {% disqus_show_comments %}

   33 :       </div>

   34 :   </div>

   35 : </main>

Traceback:
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/handlers/base.py" in get_response
  137.                 response = response.render()
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/response.py" in render
  103.             self.content = self.rendered_content
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/response.py" in rendered_content
  80.         content = template.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/loader_tags.py" in render
  126.         return compiled_parent._render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/defaulttags.py" in render
  201.                             nodelist.append(node.render(context))
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/defaulttags.py" in render
  458.                         six.reraise(*exc_info)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/utils/six.py" in reraise
  550.         raise value
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/template/defaulttags.py" in render
  444.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/urlresolvers.py" in reverse
  551.     return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
  468.                              (lookup_view_s, args, kwargs, len(patterns), patterns))

Exception Type: NoReverseMatch at /noticias/1/
Exception Value: Reverse for 'news_tags_list' with arguments '()' and keyword arguments '{'tag': 'esto?'}' not found. 1 pattern(s) tried: ['noticias/tag/(?P<tag>[\\w-]+)/$']
llazzaro commented 9 years ago

use el slug en lugar del name