0

I've tried to explore other questions here about this but having trouble diagnosing my error--hoping someone here can help me out.

Here is the full error:

NoReverseMatch at /
Reverse for 'projects' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Error during template rendering

In template /home/django/chrisblog/posts/templates/posts/home.html, error at line 0

The error happened when I tried to create a few additional pages on the website--just essentially copying the template of another page. These pages are using an extends tag with a 'base.html' template.

My URL file looks like this

from django.conf.urls import url
from django.contrib import admin
import posts.views
import sitepages.views
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', posts.views.home, name="home"),
    url(r'^resources/', sitepages.views.resources, name="resources"),
    url(r'^projects/', sitepages.views.projects, name="projects"),
    url(r'^about/', sitepages.views.about, name="about"),
    url(r'^posts/(?P<post_id>[0-9]+)/$', posts.views.post_details, name="post_detail"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

and my Views file

from django.shortcuts import render
from . import models

def about(request):
    return render(request,'sitepages/about.html')

def resources(request):
    return render(request,'sitepages/resources.html')

def projects(request):
    return render(request,'sitepages/projects.html')

Let me know if this is enough to go on. Thanks for the help.

Alasdair
  • 298,606
  • 55
  • 578
  • 516
John Rogerson
  • 1,153
  • 2
  • 19
  • 51
  • 1
    The code you have posted looks ok. Please show your home.html and base.html templates. Try restarting your server to make sure that any code changes have taken effect. – Alasdair Feb 16 '17 at 17:40
  • Possible duplicate of [What is a NoReverseMatch error, and how do I fix it?](http://stackoverflow.com/questions/38390177/what-is-a-noreversematch-error-and-how-do-i-fix-it) – Sayse Feb 16 '17 at 17:42
  • See duplicate also for help in diagnosing simliar issues – Sayse Feb 16 '17 at 17:43
  • So i ended up fixing the problem-- i don't think it was an issue with the templates at all. There was a communication error between nginx and gunicorn causing a 502 error. Looks like i have it squared away. Thanks for the help! – John Rogerson Feb 16 '17 at 20:33

0 Answers0