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 trialShana HT
3,292 PointsWhat does this mean? "provide the pk from the Article as the pk argument."
The tasks says, "I've added URL names for you but I need you to add the HTML markup for the links. Use the {% url %} tag to create the href attribute for the <a> tag. The URL name is articles_detail and you need to provide the pk from the Article as the pk argument."
My code is not passing, but I'm not sure what this means. I tried it a few ways, need help.
I also tried this with no luck: {%url 'article_detail' pk=article_pk %}
{% extends 'base.html' %}
{% load static from staticfiles %}
{% block static %}
<link rel="stylesheet" href="{% static 'css/styles.css' %}">
{% endblock %}
{% block content %}
{% for article in articles %}
<a href="{%url 'articles_detail' pk=articles_pk %}">{{ article.headline }}</a>
{% endfor %}
{% endblock %}
2 Answers
Tatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 PointsThe challenge says that you need to provide the pk
[attribute] of the Article
as the pk
argument. How would you access the pk
attribute of the article
?
Shana HT
3,292 Pointsattribute! Thank you!
article.pk ?