skip to Main Content

When I try to render a html file in django project, I get this error, and I can’t see the localhost page ’cause of this.
The error is:
NoReverseMatch at / Reverse for 'it_languages' not found. 'it_languages' is not a valid view function or pattern name.

and it languages is url for

  • in html

    Then it bolds me with yellow this:

  • Home
  • About Me
  • **

  • IT-languages
  • **

  • Projects
  • Contact
  • I expect to see my offline page rendered by django project
    Should I keep it like the original html version:

  • Home
  • About Me
  • IT-languages
  • Projects
  • Contact
  • 2

    Answers


    1. Please start by providing your urls.py, views.py, and the it_languages template.

      Login or Signup to reply.
    2. As @cbirch said, it’s impossible to exactly provide an answer without more information (preferably the code they listed).

      In general, the error ‘NoReverseMatch’ happens when you are trying to refer to an endpoint by the name, but the name doesn’t map to a provided endpoint.

      When you create a route you add an entry to the urlpatterns list in urls.py (typically) – if you don’t give them a specific name, they will be given an automatically generated name. Then in your template file, if you refer to one of these names, they have to match!

      Probably you use { url it_languages } or similar in one of your templates, but you haven’t set that as a name for a url.

      If you install django-extensions, there’s a tool (show_urls) that will allow you to list your endpoints and their names (I believe) – that may help you trace the issue down. Good luck!

      Login or Signup to reply.
    Please signup or login to give your own answer.
    Back To Top
    Search