Skip to content

Trying to access local files in aiohttp_jinja2 generated pages

License

Notifications You must be signed in to change notification settings

cclauss/where_is_lenna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

where_is_lenna

Trying to access local files in aiohttp_jinja2 generated pages. Lenna.png is at the root and in the static directory but the html files can not find her.

aiohttp_jinja2 is able to render the index.jinja2 template, filling in the name "Lenna" in all the right places, but I can not access the local Lenna.png image file no matter how hard I try...

python3 where_is_lenna.py

Solution:

Thanks, @asvetlov -- app.router.add_static() was the key!

app.router.add_static('/static/', path='./static', name='static')

aio-libs/aiohttp-jinja2#26

About

Trying to access local files in aiohttp_jinja2 generated pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages