Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku Deploy gives Template does Not Exist Error, but the Template worked fine on my Local Server #396

Open
dwfinley opened this issue Mar 15, 2019 · 9 comments

Comments

@dwfinley
Copy link

No description provided.

@dwfinley
Copy link
Author

I'm trying to deploy an app to heroku for the first time following the tutorial by Corey Shaeffer. After allowing the correct host, I tried heroku open again in the command line and got an error message saying: " TemplateDoesNotExist at /
blog/home.html, blog/post_list.html "

However those templates do exist and worked in development. No idea what is going on, super new to this. Does anyone know what could be up?

@ripulpatel
Copy link

@dwfinley , did it work for you?
I just tried and seeing below error in Heroku web logs:

2019-04-18T20:44:53.917773+00:00 app[web.1]: at emitNone (events.js:86:13)
2019-04-18T20:44:53.917774+00:00 app[web.1]: at TLSSocket.emit (events.js:185:7)
2019-04-18T20:44:53.917776+00:00 app[web.1]: at TLSSocket._finishInit (_tls_wrap.js:610:8)
2019-04-18T20:44:53.917777+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
2019-04-18T20:44:53.967693+00:00 heroku[web.1]: Process exited with status 1

@wilsonad32
Copy link

hi, i am facing the similar issue as mentioned above. May i know what is the solution for that?

@dwfinley
Copy link
Author

dwfinley commented Apr 20, 2020 via email

@wilsonad32
Copy link

I finally figure it out. In my case, the letter 't' for 'templates' need to be capitalised.
'DIRS': [os.path.join(BASE_DIR, 'Templates')],

@dwfinley
Copy link
Author

dwfinley commented Apr 21, 2020 via email

@rbed23
Copy link

rbed23 commented May 14, 2020

edit: if you are using Flask...

app = Flask(__name__, template_folder='working-templates-folder/')

add the template_folder argument above to have the app look into your 'blog' folder...

app = Flask(__name__, template_folder='blog/'

I was getting the same "jinja2.exceptions.TemplateNotFound: index.html" error raised from the flask/templating.py module, before I found this fix...

also, you can set the "EXPLAIN_TEMPLATE_LOADING" variable in both my development and staging configs (in config.py file) to 'True' like this:

class StagingConfig(Config):
    DEVELOPMENT = True
    DEBUG = True
    ENV = "Staging"
    EXPLAIN_TEMPLATE_LOADING = True

class DevelopmentConfig(Config):
    DEVELOPMENT = True
    DEBUG = True
    ENV = "Development"
    EXPLAIN_TEMPLATE_LOADING = True

to see more debug output of where the app is looking for your template files...

@PKALXI
Copy link

PKALXI commented Oct 4, 2020

so is there a solution?

@SATHYA-RUNTIME
Copy link

https://checkonce.herokuapp.com/

give me a solution for template dose not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants