Images missing with Jinja
See original GitHub issueWhen Jinja is not initialized, I can access images with <img src="database.png" />
.
However, once Jinja is initialized I can no longer access any images and the console prints an error:
Traceback (most recent call last):
File "...\source\repos\RecordPicker\env\Scripts\bottle.py", line 862, in _handle
return route.call(**args)
File "...\source\repos\RecordPicker\env\Scripts\bottle.py", line 1740, in wrapper
rv = callback(*a, **ka)
File "...\source\repos\RecordPicker\env\lib\site-packages\eel\__init__.py", line 158, in _static
template = _jinja_env.get_template(path[n:])
File "...\source\repos\RecordPicker\env\lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "...\source\repos\RecordPicker\env\lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "...\source\repos\RecordPicker\env\lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "...\source\repos\RecordPicker\env\lib\site-packages\jinja2\loaders.py", line 175, in get_source
contents = f.read().decode(self.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
According to this SO answer, it could be a Python issue where open()
doesn’t support UTF-8, but I am not totally sure.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
python - Jinja2 not displaying the images - Stack Overflow
I got a problem displaying photos from my uploads folder. I have a form where user can enter title, description and upload a...
Read more >Images missing with Jinja #125 - python-eel/Eel - GitHub
When Jinja is not initialized, I can access images with <img src="database.png" /> . ... According to this SO answer, it could be...
Read more >Image not loading in jinja/html page : r/flask - Reddit
Hello, I am starting to learn Flask/Jinja and am building a simple website to start ... I also have a folder of images,...
Read more >Jinja built-in statements/tags and functions (like Django ...
Jinja built-in statements/tags and functions classified by type of functionality: Comparison logic, loops, Python, filters, spacing, special characters and ...
Read more >Rendering Pages in Flask Using Jinja - Hackers and Slackers
Serve dynamic web pages in Flask by mastering Jinja: Flask's built-in HTML templating engine.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v0.10.2 is available on PyPi now @ClayMDMI. Mind giving that a shot and seeing if it fixes your problems?
Lovely. Sorry for the buggy experience. Hope it’s smoother sailing from here on out! 👍