Skip to content

该框架如何加载静态资源文件? #4

@skymaxu

Description

@skymaxu

文章上面写的加载静态文件如下:
templates或者static目录下的资源文件


<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/md5.js"></script>
但是这样加载是不行的,我自己试过:
D:\python_wrokplace\app-python\app>python pymintor.py wsgiapp.py
[Monitor] Watching directory D:\python_wrokplace\app-python
.....
127.0.0.1 - - [12/Jun/2016 19:23:35] "GET /static/site.css HTTP/1.1" 404 48

html文件都在templates文件加下,后面我使用绝对目录:

这样加载也不行; flask框架中,有url_for()函数;这个框架中如何实现?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions