NoReverseMatch at /courses/course/1/1/
<p>I was editing the template to include a hyperlink. But when I do I get NoReverseMatch error.</p>

<p>Reverse for 'views.hello_world' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []</p>

<p>The template file: </p>

<p>layout.html</p>

<pre><code>{% load static from staticfiles %}
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;{% block title %}{% endblock %}&lt;/title&gt;
    &lt;link rel="stylesheet" href="{% static 'css/layout.css' %}"&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class="site-container"&gt;
    &lt;nav&gt;
        &lt;a href="{% url 'views.hello_world' %}"&gt;Home&lt;/a&gt; [**Error here**]
    &lt;/nav&gt;
    {% block content %}{% endblock %}
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>urls.py</p>

<pre><code>from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from . import views


urlpatterns = [
    url(r'^courses/', include('courses.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^$', views.hello_world)
]
urlpatterns+=staticfiles_urlpatterns()
</code></pre>

<p>views.py</p>

<pre><code>from django.shortcuts import render


def hello_world(request):
    return render(request, 'home.html')
</code></pre>

<p>The line,
    Home
when removed I don't get any error. But I add, the NoReverseMatch arises. What am I doing wrong? </p>

<p>You need to give the URL a name, and refer to that name in the url tag.</p>

<pre><code>url(r'^$', views.hello_world, name='hello_world')
</code></pre>

<p>...</p>

<pre><code>&lt;a href="{% url 'hello_world' %}"&gt;
</code></pre>

python django