I decided to have the front pages such as the main landing page and the 'about me' page etc. at the root of my project instead as a different app. This means the project looks like this:
/django-helloworld
/Hello_World
__init__.py
url.py
views.py
wsgi.py
/static
style.css
/templates
index.html
My urls.py looks like this:
from django.conf.urls import url, include
from django.contrib import admin
from . import views
app_name = 'Hello_World'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^admin/', admin.site.urls),
The problem is, when I try to point to a url in my template, it works by doing:
<a href="{% url 'index' %}">Home</a>
But if I try referencing the namespace like so:
<a href="{% url 'Hello_World:index' %}">Home</a>
I get this error:
NoReverseMatch at /
'Hello_World' is not a registered namespace
What am I doing wrong? Thanks in advance.
ROOT_URLCONF?ROOT_URLCONF = 'Hello_World.urls'