我正在关注swampdragon 教程。我已经完成它,复制并粘贴所有内容,但是当我在http://localhost:8000/上时,我在 javascript 控制台中遇到了这个错误。
GET http://localhost:8000/swampdragon/js/dist/datamapper.js
GET http://localhost:8000/swampdragon/js/angular/services.js
GET http://localhost:8000/controllers.js
GET http://localhost:8000/app.js
angular.js:36Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.21/$injector/modulerr?p0=TodoApp&p1=Error%3…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.21%2Fangular.min.js%3A18%3A277)
这是我的设置:
STATIC_URL = '/static/'
# SwampDragon settings
SWAMP_DRAGON_CONNECTION = ('swampdragon.connections.sockjs_connection.DjangoSubscriberConnection', '/data')
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
DRAGON_URL = 'http://localhost:9999/'
这里是我的 index.html:
{% load static swampdragon_tags %}
html code
...
...
<!-- AngularJS -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
{% swampdragon_settings %}
<script type="text/javascript" src="{% static 'swampdragon/js/dist/swampdragon.min.js' %}"></script>
<script type="text/javascript" src="{{ STATIC_URL }}swampdragon/js/dist/datamapper.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}swampdragon/js/angular/services.js"></script>
<!-- To-do app -->
<script type="text/javascript" src="{{ STATIC_URL }}app.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}controllers.js"></script>