Application not picking up .css file (flask/python)

前端 未结 10 1838
悲&欢浪女
悲&欢浪女 2020-11-28 03:54

I am rendering a template, that I am attempting to style with an external style sheet. File structure is as follows.

/app
    - app_runner.py
    /services
          


        
10条回答
  •  悲&欢浪女
    2020-11-28 04:13

    In jinja2 templates (which flask uses), use

    href="{{ url_for('static', filename='mainpage.css')}}"
    

    The static files are usually in the static folder, though, unless configured otherwise.

提交回复
热议问题