I am trying to deploy django web app on google cloud. I have tested on local machine and it appears to be working fine. But after I test it on google cloud port 80, the javascripts don't work.
Here is the django form where I am referencing the javascript function
class ScqQuestionForm(forms.ModelForm):
class Meta:
model = Single_ans_q
fields=['question_text']
widgets = {
'question_text' : forms.Textarea(attrs={
'placeholder' : 'Question',
'cols' : 140,
'rows' : 6,
'name':'questioninput',
'id': 'questioninput' ,
'onkeyup':'func_output()',
'required': 'True',
})
}
My javascript is
window.func_output = function () {
button.disabled = true;
output.innerHTML = input.value.trim();
MathJax.texReset();
MathJax.typesetClear();
MathJax.typesetPromise([output]).catch(function (err) {
output.innerHTML = '';
output.appendChild(document.createTextNode(err.message));
console.error(err);
}).then(function () {
button.disabled = false;
});
}
I get this error in the console
Further, in the console, I see my function
The error only occurs on google cloud deployment, on local machines its running smoothly.