Jump to content

I am running a Python Flask web server to read my switches status, and I cant get past TemplateNotFound

 

The tree is this:

 

/RPiAuthGPIO

   /styles

      dark_theme_style.css

 

   /template

      index.html

 

   /server_scripts

      GPIOServer.py

 

How do I link /RPiAuthGPIO/template/index.html to the Python script properly?

 

@mahyar Are You Able To Help?

specs

Spoiler

ASRock B650I Lightning WiFi

AMD Ryzen 7 7700X

KLEVV CRAS V RGB (2x16GB) 6000MT/s out of the 7200MT/s I could be running

ASUS RTX 3060 OC (12GB)

Thermalright Frozen Edge 240 RGB

Lian Li A4-H2O

 

linux packages

Spoiler

tmux

btop

git

Link to comment
https://linustechtips.com/topic/1282342-file-paths-python-and-html/
Share on other sites

Link to post
Share on other sites

I’ve done it before I can’t remember the file path format in Python

specs

Spoiler

ASRock B650I Lightning WiFi

AMD Ryzen 7 7700X

KLEVV CRAS V RGB (2x16GB) 6000MT/s out of the 7200MT/s I could be running

ASUS RTX 3060 OC (12GB)

Thermalright Frozen Edge 240 RGB

Lian Li A4-H2O

 

linux packages

Spoiler

tmux

btop

git

Link to post
Share on other sites

1 minute ago, mahyar said:

nope this is beyond my territory 

my php html and in general web programming skills are fucked so you can not have me

Well...

specs

Spoiler

ASRock B650I Lightning WiFi

AMD Ryzen 7 7700X

KLEVV CRAS V RGB (2x16GB) 6000MT/s out of the 7200MT/s I could be running

ASUS RTX 3060 OC (12GB)

Thermalright Frozen Edge 240 RGB

Lian Li A4-H2O

 

linux packages

Spoiler

tmux

btop

git

Link to post
Share on other sites

54 minutes ago, zhnu said:

 


from flask import Flask, render_template

@app.route('/')
def index():
    return render_template('index.html')

 

When I do that I get

 

jinja2.exceptions.TemplateNotFound

jinja2.exceptions.TemplateNotFound: index.html

specs

Spoiler

ASRock B650I Lightning WiFi

AMD Ryzen 7 7700X

KLEVV CRAS V RGB (2x16GB) 6000MT/s out of the 7200MT/s I could be running

ASUS RTX 3060 OC (12GB)

Thermalright Frozen Edge 240 RGB

Lian Li A4-H2O

 

linux packages

Spoiler

tmux

btop

git

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×