xxxxxxxxxx
If you have turned 'Debug = False' and still using 'manage.py runserver'
then static files will not load.
With debug turned off Django won't handle static files for you any more
- your production web server (Apache or something) should take care of that.
xxxxxxxxxx
pip install whitenoise
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', # Add this line
# other middlewares
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
image.mefiz.com
xxxxxxxxxx
# settings.py
# Define the base URL for static files
STATIC_URL = '/static/'
# Define the location where collectstatic command will copy static files
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')