我对React(通常是前端开发)还很陌生,我正在尝试将Jumbo React Admin模板与Django集成。
我已经能够在this documentation之后自行启动Jumbo React Admin模板,并且还能够在this tutorial之后将Django与React集成。这两个教程之间的主要区别(除了目录结构之外,这不是什么大问题)是,第一个教程是基于yarn的,第二个教程是基于webpack的。我决定使用Jumbo的官方文档,并且尝试使用yarn进行集成。
到目前为止,我已经使用frontend
应用程序创建了一个Django新项目,并在其中复制了Jumbo Admin模板的目录。这是项目的结果目录结构:
您可以在图像中看到以下文件:/Users/hugovillalobos/Documents/Code/JumboDjangoProject/JumboDjango/frontend/source/public/index.html
,但是无论如何,当我运行yarn start
时,会出现以下错误:
(JumboDjangoVenv) MacBook-Pro-de-Hugo:frontend hugovillalobos$ yarn start
yarn run v1.17.3
$ react-scripts start
Could not find a required file.
Name: index.html
Searched in: /Users/hugovillalobos/Documents/Code/JumboDjangoProject/JumboDjango/frontend/public
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我不知道如何指示React在/Users/hugovillalobos/Documents/Code/JumboDjangoProject/JumboDjango/frontend/source/public
中而不是/Users/hugovillalobos/Documents/Code/JumboDjangoProject/JumboDjango/frontend/public
中搜索此类文件。
我将不胜感激。