Link to Flask static files with url_for

后端 未结 2 507
渐次进展
渐次进展 2020-11-21 07:14

How do you use url_for in Flask to reference a file in a folder? For example, I have some static files in the static folder, some of which may be

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-21 07:26

    In my case I had special instruction into nginx configuration file:

    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
                try_files $uri =404;
        }
    

    All clients have received '404' because nginx nothing known about Flask.

    I hope it help someone.

提交回复
热议问题