Closed bartwalczak closed 5 years ago
As the error says, you need to set the STATIC_ROOT configuration option (in local_settings.py), it should point to the directory where static files are served. You can find more information in Django's documentation about it : https://docs.djangoproject.com/en/2.1/ref/settings/#static-root
Sorry to ask, may I know what is the expected output?
It turns out that I was trying to follow the outdated docker image. When I changed
gunicorn -w $(($(nproc --all)*2+1)) -t 120 -b 0.0.0.0:8000 scirius.wsgi
into
python manage.py runserver
Then the whole collectstatic
step turned out to be unnecessary. So the @biolds comment was totally off the mark (I tried the obvious suggested solution but it didn't work).
@bartwalczak using runserver works, but it's supposed to be used as a development server. As the Django documentation states: DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests.
(https://docs.djangoproject.com/en/2.1/ref/django-admin/#runserver).
The way to go, is to run a wgsi server (gunicorn) behind a reverse proxy, and have STATIC_ROOT point to the static file dir.
Well, that solution didn't work for me. I'm not going to pursue this further, as I managed to test the software and realized that it is not what I am looking for.
I tried to follow manual installation steps and build my own docker image, as well as using the
scirius-docker
. Regardless of everything, the server fails to serve static files, even though the website itself is working.I narrowed it down to this: When running
python manage.py collectstatic
the following error is shown and the static files are not collected:Any help would be appreciated.