Note that there are some explanatory texts on larger screens.

plurals
  1. POReverse for '' with arguments '(1L,)' and keyword arguments '{}' not found
    primarykey
    data
    text
    <p>I'm new to Django and faced with next problem: when I turn on the appropriate link I get next error: </p> <p><code>NoReverseMatch at /tutorial/</code></p> <p><code>Reverse for 'tutorial.views.section_tutorial' with arguments '(1L,)' and keyword arguments '{}' not found.</code></p> <p>What am I doing wrong? and why in the args are passed "1L" instead of "1"? (when i return "1" i get same error.) I tried to change <code>'tutorial.views.section_tutorial'</code> for <code>'section-detail'</code> in my template but still nothing has changed. Used django 1.5.4, python 2.7; Thanks!</p> <p><code>tutorial/view.py</code>:</p> <pre><code>def get_xhtml(s_url): ... return result def section_tutorial(request, section_id): sections = Section.objects.all() subsections = Subsection.objects.all() s_url = Section.objects.get(id=section_id).content result = get_xhtml(s_url) return render(request, 'tutorial/section.html', {'sections': sections, 'subsections': subsections, 'result': result}) </code></pre> <p><code>tutorial/urls.py</code>:</p> <pre><code>from django.conf.urls import patterns, url import views urlpatterns = patterns('', url(r'^$', views.main_tutorial, name='tutorial'), url(r'^(?P&lt;section_id&gt;\d+)/$', views.section_tutorial, name='section-detail'), url(r'^(?P&lt;section_id&gt;\d+)/(?P&lt;subsection_id&gt;\d+)/$', views.subsection_tutorial, name='subsection-detail'), ) </code></pre> <p><code>urls.py</code>:</p> <pre><code>urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^tutorial/$', include('apps.tutorial.urls')), ) </code></pre> <p><code>main.html</code>:</p> <pre><code>{% extends "index.html" %} {% block content %} &lt;div class="span2" data-spy="affix"&gt; &lt;ul id="menu"&gt; {% for section in sections %} &lt;li&gt; &lt;a href="{% url 'tutorial.views.section_tutorial' section.id %}"&gt;{{ section.name }}&lt;/a&gt; &lt;ul&gt; {% for subsection in subsections%} {% if subsection.section == section.id %} &lt;li&gt;&lt;a href=#&gt;{{ subsection.name }}&lt;/a&gt;&lt;/li&gt; {% endif %} {% endfor %} &lt;/ul&gt; {% endfor %} &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="span9"&gt; &lt;div class="well"&gt; {% autoescape off%} {{ result }} {% endautoescape %} &lt;/div&gt; &lt;/div&gt; {% endblock %} </code></pre>
    singulars
    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