Django不加载静态文件

时间:2015-06-14 06:59:29

标签: jquery django

我正在为django-cms制作一个插件,我首先用纯HTML,Javascript和CSS方式创建了网页并且它工作得很好,但是当我试图让它在django-cms上工作时它似乎是不加载jquery-ui,因此破坏了我的BoarGUIFunctionality.js脚本和我的应用程序:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test</title>
</head>

{% load staticfiles %}

<script type="text/javascript" src="{% static "js/jquery-2.1.4.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery-ui.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/Board.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery.simple.timer.js" %}"></script>
<link rel="stylesheet" type="text/css" href="{% static "css/jquery-ui.min.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/jquery-ui.theme.min.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/jquery-ui.structure.min.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "css/boardStyle.css" %}">
<body>
<div id="FirstModal"><p>¿Desea comenzar su turno?</p></div>
<div id="SecondModal"><p>¿Qué tipo de turno desea comenzar?</p></div>
<div id="ConfirmationModal"><p>¿Esta seguro que desea realizar esa jugada?</p></div>
<div id="FinishTurnModal"><p>¿Desea terminar su turno?</p></div>
<div id="FinishedTurnModal">Turno Finalizado</div>
<div id="boardContainer">
    <div id="right">
        <p id="dice1"></p><p id="dice2"></p> 
        <button id="diceRoller" class="no-display">Lanzar Dados</button>
    </div>
    <div id="left"></div>
    <button id="movePlayerPieces" class="no-display">Mover fichas jugador</button>
    <button id="finishTurn" class="no-display">Finalizar Turno</button>
    <div id ="scoreContainer">
        <table>
            <tr>
                <td id="blackPlayerScore"></td><td id="whitePlayerScore"></td>
            </tr>
            <tr>
                <td id="blackPlayerName"></td><td id="whitePlayerName"></td>
            </tr>
        </table>
    </div>
    <p id="timer"></p>
</div>
</body>
<script type="text/javascript">
    var board = new Board();
    board.setGamePhase(1);
    board.setPlayerTurn('Someone');
    board.setBlackPlayer("Kevin");
    board.setWhitePlayer("Someone");
    board.setInitiatorGamePlayer("Kevin");
    var pieces = {
        black : ["a5","d7","f2","c6","e4","i4"],
        white : ["r3","h4","b9","g5","j2","k9"],
    };
    board.setBallPosition("g9");
    board.setTimeTimer("12-06-2015 09:00:00");
    board.setGoalWhite(0);
    board.setGoalBlack(0);
    board.setPiecesPosition(pieces);
    board.buildBoard("left");
    session = 'Someone';
</script>
<script type="text/javascript" src="{% static "js/BoardGUIFunctionality.js" %}"></script>
</html>

顺便说一句,我把$(function(){...})包含在BoardUIFunctionality的代码中。在settings.py上,STATIC_URL的值为/ static /,所以我无法弄清问题是什么。任何帮助将非常感谢

0 个答案:

没有答案