Forums

Static filesnot working

Hi, Im new. I tried to google my problem but nothin works... I just started new project and i have problem with "collectstatic". I have created dirs:

enter image description here

My web configuration: enter image description here

My settings.py:

if DEBUG == True:
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR),"static", "static-only")
STATICFILES_DIR = (
    os.path.join(os.path.dirname(BASE_DIR), "static", "static"),
    )

Then I run:

$ python manage.py collectstatic

Files get copied without errors. But when I try to log in my /admin/ panel it seems to be the same as before (no css stylesheets applied although they exists). I tried to restart page from "Web" section many times. Nothing works...

Im going step by step through this youtube tutorial. (12:20 - start of creating directories for static files). The only difference is version of python (I'm using 3.6 while video version is 2.7 but everything else works fine). Did I miss something?

I think the problem is your static file mappings on the "Web" tab. The "URL" should be /static/ with a leading slash, and the directory should be /home/Wincij/static/static-only -- the username is case-sensitive, and yours starts with a capital "W".

It helped. Thanks a lot.

Great, thanks for confirming!