I am new to Django. I ran the project in Debug = True
at that time all CSS and images are loading properly. I try to change Debug = False
. Now I face problems. Sometimes CSS is not loading . some times images are not loading. I have two images in the folder. One is loading and the other is not loading. In Develop mode Debug = True
at that time is working properly.
I tried restarting python3 manage.py runserver
, changing STATIC_URL = "../../static/"
with no luck. Some images are loaded, some are not.
settings.py
STATIC_URL = "/static/"
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
mysite/static/images/icon/1.png //come
mysite/static/images/icon/2.png //not come
Both 1.png and 2.png are in folder. Sometimes CSS is loading, sometimes not.
I am using python3 manage.py runserver 0.0.0.0:5000
to start the project