I have tried many of the solutions in this website to solve the issue but I still get the error. Here I put all the needed information:
views.py:
def about(request):
return render_to_response('homepage/about.html')
urls.py:
urlpatterns = patterns('blog.apps.homepage.views',
url(r'^$', 'index', name="homepage_index"),
url(r'^about/$', 'about', name="homepage_about"),
url(r'^contact/$', 'contact', name="homepage_contact"),
url(r'^archive/$', 'archive', name="homepage_archive"),
)
global urls.py:
(r'^$',include('blog.apps.homepage.urls')),
global settings.py:
ROOT_URLCONF = 'blog.urls'
tree:
templates/
├── base.html
└── homepage
├── about.html
├── archive.html
├── contact.html
└── index.html
index.html:
{% extends "base.html" %}
{% load url from future %}
{% block title %}
Index Page
{% endblock %}
{% block navi %}
<a href="{% url 'homepage_index' %}">home</a> -
<a href="{% url 'homepage_about' %}">about</a> -
<a href="{% url 'homepage_contact' %}">contact</a> -
<a href="{% url 'homepage_archive' %}">archive</a>
{% endblock %}
{% block content %}
<h3>Entries:</h3>
{%for e in entries %}
<div>{{e.title}} - {{e.created}}</div>
<div>{{e.text}}</div>
<br/>
{% endfor %}
{% endblock %}
{%block footer %}
2012 - MyBlog
{% endblock %}
Error:
Reverse for 'homepage_about' with arguments '()' and keyword arguments '{}' not found.
Try changing
(r'^$', include('blog.apps.homepage.urls'))
to
(r'', include('blog.apps.homepage.urls'))
The reason is $ sign (used to match end of string) which means that there should not come anything afterwards. But as you are including the urls then $ should not be there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With