我的应用程序结构是
project/
configuration/__init__.py
core/
static
/app
/css
/img
/js/app.js
/lib/angular/angular.js
/partials
index.html
我的文件configuration/__init__.py
有如下内容
# setting up template directory
TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../static/app')
app = Flask(__name__, template_folder=TEMPLATE_DIR, static_folder=TEMPLATE_DIR)
当我加载页面localhost/index.html
时,我看到javascript错误为
GET http://127.0.0.1:5000/js/app.js 404 (NOT FOUND) home:8
GET http://127.0.0.1:5000/lib/angular/angular.js 404 (NOT FOUND) home:8
即使我知道这些文件在那里,我猜静态文件夹找不到这些文件,我在这里做错了什么
我把相对url放在
index.html
中修复了它配置/init.py
index.html
相关问题 更多 >
编程相关推荐