Note that there are some explanatory texts on larger screens.

plurals
  1. POYaml addressing and template with GAE is not working ? TemplateDoesNotExist just by simple change in yaml ?
    primarykey
    data
    text
    <p>I have problem with using template in Google App Engine by Python. the thing is, when I address my static folder in Yaml, I can NOT access to my template and when I remove it, it is access able. look at the files.</p> <pre><code>this is my file structure -src\ ----\calc.py ----\main.py ----\index.html ----templ\ ---------\calc.html ---------\js ---------\css YAML: handlers: - url: /.* script: main.py MAIN.PY def main(): application = webapp.WSGIApplication([ ('/', MainPage), ('/calc',Calc) ], debug=True) wsgiref.handlers.CGIHandler().run(application) Calc.py class Calc(webapp.RequestHandler): def get(self): temp = os.path.join(os.path.dirname(__file__), 'templ/calc.html') outstr = template.render(temp, temp_val) self.response.out.write(outstr) </code></pre> <p><strong>THE RESULT IS : Status: 200 OK Content-Type: text/html; charset=utf-8 I can reach my file and the template addressing is working</strong></p> <p>BUTTTTTTT</p> <p>when I add the following line to my YAML to access to my css and js and so on. IT is not access able </p> <pre><code>YAML: handlers: - url: /.* script: main.py - url: /templ static_dir: templ or If i change order of them : YAML: handlers: - url: /templ static_dir: templ - url: /.* script: main.py </code></pre> <p>BOTH are NOT working and there is my error</p> <p><strong>Status: 500 Internal Server Error</strong></p> <pre>Traceback (most recent call last): File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_webapp25.py&quot;, line 701, in __call__ handler.get(*groups) File &quot;/Users/em/Documents/workspace/NerkhARZ/src/calc.py&quot;, line 26, in get outstr = template.render(temp, temp_val) File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py&quot;, line 88, in render t = load(template_path, debug) File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py&quot;, line 185, in load return _load_user_django(path, debug) File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/template.py&quot;, line 110, in _load_user_django template = django.template.loader.get_template(file_name) File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django_0_96/django/template/loader.py&quot;, line 79, in get_template source, origin = find_template_source(template_name) File &quot;/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django_0_96/django/template/loader.py&quot;, line 72, in find_template_source raise TemplateDoesNotExist, name TemplateDoesNotExist: calc.html </pre> <p>Please help me through this, there must be simple solution for it. I really dont believe that GAE is that much fool....</p> <p>Thank you in advanced</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload