F5F Stay Refreshed Power Users Networks Paths in Python, HTML integration

Paths in Python, HTML integration

Paths in Python, HTML integration

F
FischersMaxe
Junior Member
13
10-08-2023, 03:46 PM
#1
You're trying to connect your Flask app with a template file. Make sure you include the correct path in your Flask app's URL configuration. Link the template like this:

```python
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
return render_template('index.html') # Adjust the path if needed
```

Ensure `index.html` is in the correct directory relative to your app's root. If you're using a subdirectory, update the path accordingly.
F
FischersMaxe
10-08-2023, 03:46 PM #1

You're trying to connect your Flask app with a template file. Make sure you include the correct path in your Flask app's URL configuration. Link the template like this:

```python
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
return render_template('index.html') # Adjust the path if needed
```

Ensure `index.html` is in the correct directory relative to your app's root. If you're using a subdirectory, update the path accordingly.

U
Uselesstimo
Junior Member
12
10-13-2023, 07:02 PM
#2
afaik you have to do it in php
U
Uselesstimo
10-13-2023, 07:02 PM #2

afaik you have to do it in php

_
_Kibbu_
Member
74
10-14-2023, 01:28 AM
#3
I’ve handled similar situations before, though I can’t recall the exact file path structure.
_
_Kibbu_
10-14-2023, 01:28 AM #3

I’ve handled similar situations before, though I can’t recall the exact file path structure.

I
Ihuskymc
Junior Member
16
10-29-2023, 11:26 PM
#4
I
Ihuskymc
10-29-2023, 11:26 PM #4

S
skyplaysYT
Member
70
10-30-2023, 05:26 AM
#5
Well...
S
skyplaysYT
10-30-2023, 05:26 AM #5

Well...

F
flyer78
Senior Member
425
11-04-2023, 06:52 AM
#6
You encounter a missing template error when trying to load index.html.
F
flyer78
11-04-2023, 06:52 AM #6

You encounter a missing template error when trying to load index.html.