-2

I am trying to connect html and css files in flask app (pycharm ide) but not getting as how to do this.Here is the screenshot image link

1
  • add code of flaskdata.py in the question. Let us see what have you been trying to add the templates. Commented Oct 11, 2017 at 5:02

1 Answer 1

0

In the template file to add CSS/JS use:

<link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}"> 

In flaskdata.py (I assume this is the main file) render the template you have added:

from flask import render_template, flash, redirect, request, url_for @app.route('/') def index(): return render_template('index.html') 

Thus you can continue adding static CSS/JS files in the templates and render the required template in suitable routings.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.