Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Final Details url Tag

Vijayakumar Ramakrishnan
Vijayakumar Ramakrishnan
1,163 Points

Could not parse the remainder: '=' from '='

I am getting Could not parse the remainder: '=' from '='

Below is the error log

Error during template rendering

In template C:\treehouse\learning_site\courses\templates\courses\course_list.html, error at line 9
Could not parse the remainder: '=' from '='
1   {% extends 'layout.html' %}
3   {% block title %}Available Courses{% endblock %}
5   {% block content %}
6   <div class = "cards">
7       {% for course in courses %}
8           <div class = "card">
9               <header><a href= "{% url 'courses:course_link' pk = course.pk %}">{{ course.title }}</a></header>
10               <div class="card-copy">
11                  {{ course.description }}
12              </div>
13          </div>
14      {% endfor %}
15  </div>
16  {% endblock %}

[MOD: added ```python and html+jinja formatting -cf]

2 Answers

Oszkár Fehér
.a{fill-rule:evenodd;}techdegree seal-36
Oszkár Fehér
Treehouse Project Reviewer


When you put class inside a tag it should look like this: hre, class="your text or whatever u need to put here", no spacing alowed . this could be one of the problem, the other one it could be the url pattern. make sure you write exactly what Kenneth shows.

Vijayakumar Ramakrishnan
Vijayakumar Ramakrishnan
1,163 Points

Thanks Oszkar. You helped me narrow down to the issue. The issue resolved when i modified the text pk = course.pk in the line 9 to pk=course.pk. Spacing was the issue. Class worked fine even with the spacing.