python - Flask-frozen don’t work whereas flask is ok -
i have website using flask. main program pretty long, i’ve used a paste show code. when run ./site serve --debug works perfectly, can’t freeze flask-frozen. have error :
$ ./site build building website... ./site:240: mimetypemismatchwarning: filename extension of u'sitemap.xml' (type application/xml) not match content-type: text/html; charset=utf-8 freezer.freeze() traceback (most recent call last): file "./site", line 346, in <module> parser.dispatch() file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/helpers.py", line 53, in dispatch return dispatch(self, *args, **kwargs) file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 123, in dispatch line in lines: file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 199, in _execute_command line in result: file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 182, in _call result = args.function(*positional, **keywords) file "./site", line 240, in build freezer.freeze() file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/flask_frozen/__init__.py", line 140, in freeze new_filename = self._build_one(url) file "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/flask_frozen/__init__.py", line 250, in _build_one % (response.status, url)) valueerror: unexpected status '500 internal server error' on url /403.html if delete part 403.html in site.py, have same error 404, 500, contact.html, /. , can’t find why. there has idea ?
enable testing while freezing application. should produce more information error.
@command def build(): """ builds site. """ print("building website...") app.debug = false app.testing = true asset_manager.config['assets_debug'] = false freezer.freeze() local("cp ./static/*.ico ./build/") local("cp ./static/*.txt ./build/") local("cp ./static/*.xml ./build/") print("done.") frozen-flask uses app.test_client() @ it's docs.
Comments
Post a Comment