I'm new to Django (1.5) and I'm having a hard time to relative configuration of the media folder in MEDIA_ROOT. I can't charge the files .css, .js, .jpg in my project. I receive the following msg in the shell:
[06/Oct/2013 19:12:01] "GET /media/css/style.css HTTP/1.1" 404 4140
this is tree of the project:
- _3Ms
- _3Ms
- apps
- media
- css
- js
- images
- template
this is my configuration
setting.py
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/')
MEDIA_URL = '/media/'
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = '_3Ms.urls'
WSGI_APPLICATION = '_3Ms.wsgi.application'
TEMPLATE_DIRS = os.path.dirname(__file__), 'templates',
)
home.html
{% block css %}<link href="/media/css/style.css" rel="stylesheet">{% endblock %}
Thank you in advance