Search code examples
htmldjangotemplatesrunnable

Using Django on Runnable. cant render a simple html


I'm trying to use django and render a simple html on Runnable. I guess I'm missing something obvious but I get the error "Template does not exist" all the time.

This is the code: runnable

Thanks in advance for your help.


Solution

  • You need to set TEMPLATE_DIRS var in Django Settings (Settings.py) like the code comment says, to let Django get all the templates successfully.

    Put os.path.join(os.path.dirname(__file__),"templates") in the variable and import os.path in python. Make a templates folder inside your app folder, and move all the .html files there.