TemplateDoesNotExist on python app-engine django 1.2 while template rendering relative paths

前端 未结 2 2007
迷失自我
迷失自我 2020-12-29 11:12

I\'m running the 1.4.2 appengine SDK locally on a windows machine. I have an application running Django 0.96. The template rendering is using the django wrapper from

2条回答
  •  無奈伤痛
    2020-12-29 11:48

    One reason you get the error message TemplateDoesNotExist: templates\AdminListstr.html

    Doublecheck the slash you use between "templates" and your template name. I wasted a few hours, then checked the value being returned by os.path.join.

    In summary you need to insure you are using "/" not the Windows "\". If you use the wrong slash, your code will work on (Windows) development but fail when deployed.

    My diagnostic code printed this: look at the last slash And the value returned by os.path.join is:/base/data/home/apps/s~myapp/1.356037954289984934/templates\LabListstr.html

    Aye yi yi!

提交回复
热议问题