Oct-13-2017, 10:25 AM
(Oct-13-2017, 09:57 AM)Dutchpy Wrote: is that the error message you referred to?
Sorry my bad, Django doesn't give an error for static files its only templates.
You are getting 404 not found error.
refer to: https://docs.djangoproject.com/en/2.0/ho...tic-files/
make sure you have these settings:
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(PROJECT_DIR) # Static files (CSS, JavaScript, Images) STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ] STATICFILES_DIRS = [ # For static files not particular to any app. os.path.join(PROJECT_DIR, 'static'), ] STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' # eg 127.0.0.1/static/If still, it doesn't work try:
python manage.py collectstatic
And check your STATIC_ROOT. Your file should exist there and be served too.