Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/09/2015, 09:23
letni
 
Fecha de Ingreso: octubre-2008
Mensajes: 276
Antigüedad: 15 años, 5 meses
Puntos: 1
Pregunta No se cargan los css

Hola a todos,

He creado una carpeta static al mismo nivel que la carpeta templates, dentro de dicha carpeta tengo la carpeta css que contiene los archivos animation.css, reset.css y styles.css.

En settings.py he añadido esto:

Código:
RUTA_PROYECTO = os.path.dirname(os.path.realpath(__file__))

STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(RUTA_PROYECTO,'static'),
)
Tengo este código:

Código:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!-- Title Page -->
		<title>Login</title>

		<!-- CSS -->
		<link rel="stylesheet" href="{{STATIC_URL}}css/reset.css">
		<link rel="stylesheet" href="{{STATIC_URL}}css/animation.css">
		<link rel="stylesheet" href="{{STATIC_URL}}css/styles.css">
	</head>
	<body>
		<div id="container">
			<form>
				<!-- Username -->
				<label for="name">Username:</label>
				<input type="name">
				<!-- Password -->
				<label for="username">Password:</label>
				<input type="password">
				<div id="lower">
					<!-- Submit Button -->
					<input type="submit" value="Login">
				</div>
			</form>
		</div>
	</body>
</html>
pero luego a la hora de cargar la página no se cargan los css y obtengo errores 404 del tipo:

[03/Sep/2015 17:11:53] "GET /static/reset.css HTTP/1.1" 404 1640
[03/Sep/2015 17:11:53] "GET /static/animation.css HTTP/1.1" 404 1652
[03/Sep/2015 17:11:53] "GET /static/styles.css HTTP/1.1" 404 1643

¿Qué puede estar pasando?

Saludos.
__________________
Uso Apache 2.2 con PHP 5.5.9 y MySQL 5.1
Uso Eclipse IDE for Java Developers, Version: Mars.1 Release (4.5.1), Build id: 20150924-1200 para programar en Java bajo Windows