Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我无法使用react、mobx、axios、django调用我的django上的函数_Django_Reactjs_Axios_Mobx - Fatal编程技术网

我无法使用react、mobx、axios、django调用我的django上的函数

我无法使用react、mobx、axios、django调用我的django上的函数,django,reactjs,axios,mobx,Django,Reactjs,Axios,Mobx,正在调用my mobx store中的函数,但axios找不到我的django函数 store.jsx import{autorun,observatable,action,computed}来自'mobx'; 从“axios”导入axios; axios.defaults.xsrfHeaderName=“X-CSRFToken”; 类ProductyTypeStore{ @可观察的producttypelist=[]; @操作addProductType(说明){ console.log(“

正在调用my mobx store中的函数,但axios找不到我的django函数

store.jsx

import{autorun,observatable,action,computed}来自'mobx';
从“axios”导入axios;
axios.defaults.xsrfHeaderName=“X-CSRFToken”;
类ProductyTypeStore{
@可观察的producttypelist=[];
@操作addProductType(说明){
console.log(“存储添加前”);
axios.post(“/addproducttype/”)
.然后(功能(res){
控制台日志(res);
})//那么
.catch(函数(err){
控制台日志(err);
})
console.log(“存储添加后”);
}
}
var store1=window.store=new ProductyTypeStore

导出默认存储1
结果发现它与我的URL.PY配置有关。它应该是url(r'^',erp,name=“erp”),而不是url(r'^',erp,name=“erp”)

事实证明,这与我的url.PY配置有关。它应该是url(r'^',erp,name=“erp”),而不是url(r'^',erp,name=“erp”)