You’re using the staticfiles app without having set the static_root setting to a filesystem path.

The error message “you’re using the staticfiles app without having set the static_root setting to a filesystem path.” indicates that the staticfiles app in your Django project is not properly configured. In order to fix this issue, you need to set the STATIC_ROOT setting to a valid filesystem path.

The STATIC_ROOT setting in Django specifies the absolute path to the directory where the collectstatic management command will copy static files when using the staticfiles app. This is typically used in production environments where static files are served directly by a web server such as Nginx or Apache.

Here’s an example of how you can set the STATIC_ROOT setting in your Django project’s settings.py file:

    
STATIC_ROOT = '/path/to/static/files/'
    
  

Replace /path/to/static/files/ with the actual filesystem path where you want the static files to be collected.

Once you have set the STATIC_ROOT setting, you can run the collectstatic management command to collect all the static files from your various apps into the specified directory. For example, run the command python manage.py collectstatic.

After running the collectstatic command, you should have a directory structure under the STATIC_ROOT directory containing all the static files. These files can then be served by your web server.

Read more

Leave a comment