アプリで django-autocomplete-light を動作させようとしています。すべてのセットアップが完了したと思います。
問題と思われることの 1 つは、{% include 'autocomplete_light/static.html' %} を含める場合です。私のアプリは、以下にリストされている必要な .js ファイルを見つけていないようです。ディレクトリに移動しても、ファイルが表示されません。github のダウンロードにはこれらのファイルが含まれているはずだと思いました。これらの js ファイルはどこにダウンロードすればよいですか? または、ディレクトリ構造が間違っている可能性がありますか?
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/autocomplete.js HTTP/1.1" 404 1715
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/django_admin.js HTTP/1.1" 404 1715
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/text_widget.js HTTP/1.1" 404 1712
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/widget.js HTTP/1.1" 404 1697
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/style.css HTTP/1.1" 404 1697
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/addanother.js HTTP/1.1" 404 1709
[21/Nov/2015 10:59:30] "GET /static/autocomplete_light/remote.js HTTP/1.1" 404 1697
HTML:
{% load staticfiles %}
<script type="text/javascript" src="{% static 'jquery.js' %}">
$(document).ready(function() {
$('#add_user_accounts').InstitutionAutocomplete({
url: '{% url 'add_user_accounts' %}',
choiceSelector: 'a',
}).input.bind('selectChoice', function(e, choice, autocomplete) {
document.location.href = choice.attr('href');
});
});
</script>
{% include 'autocomplete_light/static.html' %}
<input type="text" name="q" id="add_users_accounts" placeholder="Find your institution" style="width: 270px; font-size: 12px;" />
<style type="text/css">
/* cancel out django default for now, or choices are white on white */
#header a.choice:link, #header a.choice:visited {
color: black;
}
</style>
ディレクトリ構造:
app/
static/jquery.js
autocomplete_light/