私はdjangoとpython初心者です。 Djangoアプリケーションはapache webserverでデーモンとしてホストされています。 私は、Javaスクリプトを使用してdjangoでURLをレンダリングする際に問題に直面しています。ハンドルバーの変更は影響を受けません - Python Django
私のハンドルバー(htmlテンプレート)では、いくつかのHTML変更を行いましたが、残念ながら変更は反映されていません。
フローのように、ブラウザからURLを呼び出すと、私のurls.pyはviews.pyを呼び出し、views.pyの中でNode_edit.htmlがレンダリングされます。
Node_edit.htmlにはハンドルバーが含まれます。
私の貧しい私の英語のために申し訳ありません。
views.py
@csrf_protect
DEF hierarchyNode_new(リクエスト、parentNode_id =なし):
parentNodeObject = None
if(parentNode_id):
context = {
"parentNode_id": parentNode_id
}
return render(request, 'test/Node_edit.html', context)
Node_edit.html
{% load staticfiles %}
var assetList =
[
//applying the html template
{ url: '{% static "test/handlebar/Node.handlebar" %}', loadHandler: templateLoaderFunction, name: 'Node_edit' },
]
$(document).ready(function() {
debug.log("load complete")
registerHandlebarHelpers()
// create templates hash if not already present
Handlebars.templates = Handlebars.templates || {};
console.log(assetList);
chainLoadAssets(assetList, function()
{
var hierarchyNodeEditor = new HierarchyNodeEditor(
"{% url 'test:index' %}",
"{% url 'test:Node_list' %}",
{% if Node %}
"{% url 'test:Node_jsonbase' %}",
{% else %}
"{% url 'test:Node_new' %}",
{% endif %}
"{{ Node.id }}",
"{{ parentNode_id }}",
"{{ csrf_token }}"
)
NodeEditor.start()
})
})
</script>
Node.handlebar
<div class="col-sm-7">
<input type="checkbox" id="Node_edit_display" checked="checked" (Trying to make check box checked)
{{#ifeq json.display "1" }}
checked
{{/ifeq}}
/>
</div>
注:私はそのハンドルを削除した場合であっても。しかし、まだページがレンダリングされています。しかし、問題は、私の変更はブラウザに反映されていません
私は私のブラウザのキャッシュをクリアし、Apacheを再起動しました。
疑問:
私はクリアする必要がありますか?
これは私のステージサーバーです。 しかし、この問題は私の開発サーバーにはありません。
この問題に直面しているステージサーバーの変更を適用するとき。
私はこれにこだわっています。どんな助けもありがとう。