Wednesday, December 27, 2017

Re: tutorial p.6 problem: style.css isn't loaded

Same error happens to me, 

Restart mysite with `python manage.py runserver` fix it.

It may because new created files not auto detected by django.

Best,

On Wednesday, February 5, 2014 at 9:45:20 AM UTC-8, Janek Warchoł wrote:
Hello,

i'm following Django's tutorial (very nice, btw) and static files don't work for me.  I have a test project created along the previous parts of the tutorial, and now i'm here: https://docs.djangoproject.com/en/1.6/intro/tutorial06/#customize-your-app-s-look-and-feel

According to instructions, I've added a style.css file to BASE_DIR/polls/static/polls/ subdir and inserted

{% load staticfiles %}

<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}" />

into my polls/templates/polls/index.html - however, it doesn't have any effect (i.e. the links in the poll list aren't green), and when i look into the shell where Django development server is running, i see

"GET /static/polls/style.css HTTP/1.1" 404 1649

so, it seems that the file cannot be accessed at all.  But i'm at a loss of why it doesn't work :(

Any ideas?
If anyone wants to look at my code, it's here:
https://github.com/j-warchol/django-test

best,
Janek

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9c4f0a4c-4451-4f6c-aa88-dca33c83b7e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment