GAE: Flask / webassets returns an expiration on {% extends "base.html"%}

I am trying to migrate an existing flash application to the google engine. After many reading and solving problems, I ran into a problem that I was completely stuck with:

After running the application in the local environment, I get the following error message:

Short version:

{% extends "base.html" %} OSError: [Errno 38] Function not implemented 

How can this function not be implemented? This is part of the jar / jinja 2.

Longer version:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>500 Internal Server Error</title> <h1>Internal Server Error</h1> <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p> ERROR 2013-06-17 14:26:42,772 app.py:1306] Exception on / [GET] Traceback (most recent call last): File "/home/kave/eclipse/F11/Engineering/flask/app.py", line 1687, in wsgi_app response = self.full_dispatch_request() File "/home/kave/eclipse/F11/Engineering/flask/app.py", line 1360, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/kave/eclipse/F11/Engineering/flask/app.py", line 1358, in full_dispatch_request rv = self.dispatch_request() File "/home/kave/eclipse/F11/Engineering/flask/app.py", line 1344, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/kave/eclipse/F11/Engineering/f11_app/views.py", line 28, in index return render_template('index.html') File "/home/kave/eclipse/F11/Engineering/flask/templating.py", line 125, in render_template context, ctx.app) File "/home/kave/eclipse/F11/Engineering/flask/templating.py", line 107, in _render rv = template.render(context) File "/home/kave/eclipse/F11/Engineering/jinja2/environment.py", line 969, in render return self.environment.handle_exception(exc_info, True) File "/home/kave/eclipse/F11/Engineering/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "/home/kave/eclipse/F11/Engineering/f11_app/templates/index.html", line 1, in top-level template code {% extends "base.html" %} OSError: [Errno 38] Function not implemented INFO 2013-06-17 14:26:42,799 server.py:593] default: "GET / HTTP/1.1" 500 291 

Any idea what this could be? Thank you very much

+2
source share
1 answer

This error appeared because Jinja does not know about the assets tag used in the template. The second problem is that the project should work on GAE with the python webasset library. But by default it does not work, since webassets requires an output folder to store compressed static files, and this contradicts the GAE hosting logic.

The solution is simple: do not use real-time webassets and compress static files before uploading to GAE.

+4
source

Source: https://habr.com/ru/post/947762/


All Articles