【发布时间】:2018-11-17 13:49:08
【问题描述】:
我想在 ajax 成功后渲染 html 页面。但我没有得到文件的正确路径。我正在使用 django 后端。我没有使用 django 内置函数进行身份验证。 this is my python code. this is the error this is my project structure
//this is my javascript code
function admin_login(){
username = document.getElementById("username").value;
password = document.getElementById("password").value;
console.log(username+password);
data={
"username":username,
"password":password
}
$.ajax({
type: 'POST',
url: "http://127.0.0.1:8000/admin_login/",
data:JSON.stringify(data),
success: function(data) {
console.log('sucessfully loggedin')
window.location.href = "/chat/templates/user.html";
}
});
}
【问题讨论】:
标签: javascript django python-3.x