python - Issues about flask static file configuration 404
習慣沉默
習慣沉默 2017-05-18 10:56:06
0
2
611

I placed a static under the root directory of the project and wrote a simple route to test access, but it always got 404

The project structure is as follows:

The code of views.py is as follows:


Could you please give me some guidance? The permissions of the file have been set to 777

習慣沉默
習慣沉默

reply all(2)
大家讲道理

Routes for static directories will not be registered by default when blueprint objects are created. We need to specify the static_folder parameter when creating.

小葫芦

Create a new templates directory in the root directory, and then drop your template files into it. And what you set is static, which is only used to store static files, such as css and javascript files.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!