Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.