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 Django Templates Static Assets

Jacqueline McKinney
Jacqueline McKinney
2,627 Points

Can't complete the challenge following the Static Assets video. Anyone else having issues with it?

This challenge isn't working for me. I did the same thing from the static assets lesson and it's not accepting the answer. I have sent a email to help @ teamtreehouse, hopefully someone will get back to me.

Jacqueline McKinney
Jacqueline McKinney
2,627 Points

https://teamtreehouse.com/library/django-basics/django-templates/static-tag

The question is:

Challenge Task 2 of 2

Now that we have the tag available, we can use it in our <link> tag. Use {% static %} to reference the "css/styles.css" file >in the href attribute of the <link> tag.

The file in the challenge is articles/templates/articles/article_list.html My solution is:

{% load static from staticfiles %}

{% extends 'base.html' %}

{% block static %}
<link rel="stylesheet" href="{% static 'css/style.css' %}">
{% endblock %}

{% block content %}
{% for article in articles %}
{{ article.headline }}
{% endfor %}
{% endblock %}

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Check your filename. It should be styles with an s.

Jacqueline McKinney
Jacqueline McKinney
2,627 Points

Oh my, what a dope. Thank you. I was hung up on "can't find static tag" and was thinking it was complaining about the word 'static'. I double/triple checked the spelling of 'static' .