I'm trying to install django debug toolbar to track ORM queries to the database. Got this erorr

WARNINGS:
?: (debug_toolbar.staticfiles.W001) debug_toolbar requires the STATICFILES_DIRS directories to exist.
        HINT: Running manage.py collectstatic may help uncover the issue. 

Decided to run python manage.py collectstatic and getting the error Here's the settings files.

settings.py



INSTALLED_APPS = [
    #...
    'django.contrib.staticfiles',
    #..
    'debug_toolbar',
]

MIDDLEWARE = [
    #...
    'debug_toolbar.middleware.DebugToolbarMiddleware', 
]

# ...

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': str(os.path.join(BASE_DIR, "db.sqlite3")),
    }
}


# ....

STATIC_URL='/static/'
STATICFILES_DIRS =[
    os.path.join(BASE_DIR,'static').replace("\\", "/"),
]

1

There are 1 best solutions below

0
On

I found it. In your project's root directory, create a new directory called static_files. It should be alright now that that directory exists, and it seems to be needed because debug_toolbar queries that folder for files, for some reason without first checking whether the folder exists or not.