That shouldn't be necessary, as the tutorial has you put the CSS file into
the static directory in your polls app, not your project. Static files in
your polls app should be found with the default settings:

Django’s STATICFILES_FINDERS
> <https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-STATICFILES_FINDERS>
>  setting contains a list of finders that know how to discover static
> files from various sources. One of the defaults is AppDirectoriesFinder which
> looks for a “static” subdirectory in each of the INSTALLED_APPS
> <https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-INSTALLED_APPS>,
> like the one in polls we just created. The admin site uses the same
> directory structure for its static files.


My guess is that you put your CSS file at static/polls/style.css (relative
to BASE_DIR) instead of polls/static/polls/style.css

Hope that helps,
Daniel


On Tue, Aug 21, 2018 at 2:01 PM Alesh Houdek <m...@alesh.com> wrote:

> I'm doing the Django tutorial and got stuck on the static files section:
> https://docs.djangoproject.com/en/2.1/intro/tutorial06/#customize-your-app-s-look-and-feel
>
>
> Could not get the style.css file to work despite triple-checking
> everything.
>
> After much research, I got it to work by adding this to settings.py:
>
> STATICFILES_DIRS = (
>     os.path.join(BASE_DIR, "static"),)
>
> --
> 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+unsubscr...@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/f5e58b12-a8d2-4ad2-983b-856895a91eb4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f5e58b12-a8d2-4ad2-983b-856895a91eb4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@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/CAHEnUVX33dr9di4doSe0_gqzdTEzK%3DsWtujR7%3DiUTJmUK_ysng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to