[Answer]-Django serving static css files

1👍

Here’s how I usually go about managing dynamic project root:

from os.path import dirname, realpath, join
PROJECT_ROOT = dirname(realpath(__file__))

And then further below, the static root:

STATIC_ROOT = join(PROJECT_ROOT, 'static/')    

And then you reference static files like so:

{{ STATIC_URL }}css/Style.css

EDIT:

See the documentation for more information.

Leave a comment