I know this question has been answered a lot but I can't seem to work this out. My static files are there, at the location I've told django they are. Debug is set to True, and static_url is set to '/static/' but the static files are 404ing.
development(settings).py
DEBUG = True
logger.info(f"Debug is {DEBUG}")
STATIC_URL = "/static/"
STATIC_ROOT = "/home/phillyharper/dask/static"
logger.info(STATIC_ROOT)
Running python manage.py runserver
using these settings produces this result:
2021-05-09 07:17:03.197 | INFO | dask.settings.development:<module>:4 - Debug is True
2021-05-09 07:17:03.197 | INFO | dask.settings.development:<module>:47 - Debug is True
2021-05-09 07:17:03.197 | INFO | dask.settings.development:<module>:50 - /home/phillyharper/dask/static
2021-05-09 07:17:03.198 | INFO | dask.settings:<module>:7 - DEV SETTINGS SETTINGS
2021-05-09 01:47:03.417 | INFO | dask.settings.development:<module>:4 - Debug is True
2021-05-09 01:47:03.417 | INFO | dask.settings.development:<module>:47 - Debug is True
2021-05-09 01:47:03.417 | INFO | dask.settings.development:<module>:50 - /home/phillyharper/dask/static
2021-05-09 01:47:03.417 | INFO | dask.settings:<module>:7 - DEV SETTINGS SETTINGS
However, when I click onto the page - none of the static files load. They all 404, giving this:~
[09/May/2021 01:47:51] "GET / HTTP/1.1" 200 22203
[09/May/2021 01:47:51] "GET /static/src/assets/lib/perfect-scrollbar/css/perfect-scrollbar.css HTTP/1.1" 404 1800
[09/May/2021 01:47:51] "GET /static/src/assets/lib/material-design-icons/css/material-design-iconic-font.min.css HTTP/1.1" 404 1854
[09/May/2021 01:47:51] "GET /static/src/assets/css/app.css HTTP/1.1" 404 1692
[09/May/2021 01:47:51] "GET /static/src/assets/lib/jquery/jquery.min.js HTTP/1.1" 404 1731
[09/May/2021 01:47:51] "GET /static/src/assets/lib/bootstrap/dist/js/bootstrap.bundle.min.js HTTP/1.1" 404 1794
[09/May/2021 01:47:51] "GET /static/src/assets/lib/perfect-scrollbar/js/perfect-scrollbar.min.js HTTP/1.1" 404 1806
[09/May/2021 01:47:51] "GET /static/src/js/app.js HTTP/1.1" 404 1665
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar1.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar.png HTTP/1.1" 404 1701
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar2.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/assets/lib/bootstrap/dist/js/bootstrap.bundle.min.js HTTP/1.1" 404 1794
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar3.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar4.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar6.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/assets/img/avatar5.png HTTP/1.1" 404 1704
[09/May/2021 01:47:51] "GET /static/src/js/app.js HTTP/1.1" 404 1665
I found another thread which said use findstatic. I tried that but it shows that Django only seems to be looking inside my virtual env for static, and its not trying at the location of STATIC_ROOT. Even though findstatic doesn't find it, I can confirm the css file below does exist.
/home/phillyharper/dask/static/src/assets/css/app.css
>> python manage.py findstatic --verbosity 2 src/assets/css/app.css
No matching file found for 'src/assets/css/app.css'.
Looking in the following locations:
/home/phillyharper/.cache/pypoetry/virtualenvs/django_signally-JCl81_Vu-py3.8/lib/python3.8/site-packages/django/contrib/admin/static
/home/phillyharper/.cache/pypoetry/virtualenvs/django_signally-JCl81_Vu-py3.8/lib/python3.8/site-packages/django_extensions/static
This is my django project structure, running on WSL2.
.
├── certbot
│ └── conf
│ ├── accounts
│ ├── csr
│ └── keys
├── dask
│ ├── apps
│ │ ├── core
│ │ ├── ethscan
│ │ ├── pricegrabber
│ │ ├── scraping
│ │ ├── trader
│ │ └── twitter
│ └── dask
│ ├── __pycache__
│ └── settings
├── nginx
│ └── user_conf.d
└── static
└── src
├── assets
├── html
├── js
└── sass