Home:ALL Converter>Django: static files returning 404 error

Django: static files returning 404 error

Ask Time:2014-07-26T12:14:48         Author:user3105189

Json Formatter

I want to be able to load my static files on my local server, but when I request them, the browser returns 404 for every resource.

From what I can understand, STATIC_URL is the url in which my static files will be served. And STATICFILES_FINDERS specifies how my static files will be discovered. I set STATICFILES_DIRS to search for the static directory at the project root, but it doesn't seem to be be finding it.

On my settings.py,

# Python 2.7.5, Django 1.6

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

STATIC_URL = '/static/'

STATICFILES_FINDERS = (
   'django.contrib.staticfiles.finders.FileSystemFinder',
   'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)

This is my directory structure:

.
|-- myapp
   |-- settings.py
   |-- ...
   static
   |-- images
   |-- javascript
   |-- stylesheets

Author:user3105189,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24967469/django-static-files-returning-404-error
yy