A while ago, I attempted to use "collectstatic" in Django to serve my static files and failed miserably. Now I am finally trying to get my static files serving correctly in my development environment. I can't figure out what has gone wrong.
When I run python manage.py findstatic images/add.png
console returns:
base path: C:\Projects\AlmondKing\AlmondKing
static files dirs: C:\Projects\AlmondKing\AlmondKing\static
No matching file found for 'images/add.png'.
The directory paths are correct, but it still can't locate my files. I've tried a number of different settings configurations to no avail. Can anyone spot my problem? Here are what I think are all the relevant settings:
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'AlmondKing.InventoryLogs',
'AlmondKing.FinancialLogs',
'AlmondKing.AKGenius',
)
STATIC_URL = '/static/'
STATIC_FILES_DIRS = (
os.path.join((BASE_DIR), "static")
)
print("base path:", BASE_DIR)
print("static files dirs:", STATIC_FILES_DIRS)
EDIT: I found the findstatic --verbosity 2 command
and the only directory being searched is: C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\contrib\admin\static
Apparently it is only looking in my virtual environment, instead of my project directory. Is this normal Django behavior?