Bottle Python Web Framework - Static Files
Вставка
- Опубліковано 24 жов 2016
- In this video I'll show you how to handle static files inside of Bottle templates.
Need one-on-one help with your project? I can help through my coaching program. Learn more here: prettyprinted.com/coaching
you promised people here the continue in this playlist, but for more than 3 years you didn't.
hope you continue. your explanation of things is clear and short
I'm glad i needed this video only a few days after you publish it. i had to watch if several times but finally i got it!
I'm glad it helped. Thanks for watching!
You present some really cool stuff on the Bottle Framework. I think it would be cool if you could create a real world example like a one pager site or a basic business page. Just my two cents, bro 😅
Great videos!! Wished you would have kept making them
Seus vídeos são ótimos! Obrigado por falar sobre bottle
De nada!
You rock!
Thanks for the video. If I have a directory like this : /static/images/myimg.jpg and also /static/css/style.css how I can rout this files?
Thanks for share.
Do you have a video or published example explaining about session with Bottle? Or, How to make sessions with Bottle?
Kind regards.
Thanks a lot 😘😘😘
You're welcome!
I'm really curious about Bottle. So more tutorial about it, please!
I do have a Bottle playlist: ua-cam.com/play/PLXmMXHVSvS-AyIwEYkGNa4WE1AR1_45mv.html
I'll definitely make more videos in the future.
Very need tutorial for make user register/login on Bottle ;) I know, you more liked Flask, but anyway.. please continue lessons for Bottle..
Will do!
I faced really small error. but unfortunately I was not able to solve it. POST method call works through postman, but doesn't work from the browser!! I get this message:
AttributeError("'NoneType' object has no attribute 'get'",)
I will really appreciate it if someone can help. OR guide me to a complete example that shows the whole posting process between the html/browser and Python.
okay, then how can I do that in .tpl? like if I have a .css file in myfiles>styles>classic.css how do I write it in .tpl?
if i do wont work for me.
It should be a combination of what you're doing and what's in the video.
So if you create the route for static files, then you could have something like this in the template:
yeah, you did notice that I have "styles" folder in my static folder right? It will work if I just leave the classic.css in the static folder but won't work if classic.css is in another folder, so I found another solution by using @bottle.get('/static/') decoration instead of @bottle.route('/static/'), with that, I can load the folder with the file like so .
Also thanks for the tutorial.
try: (with the dot for working directory -> ./static...)
in myfiles i'd like to have and extra map called images but I cannot do that, any tips?
I'm not exactly sure what you mean. Could you give me an example of what you'd like your static_file arguments to be?
In myfiles I would like to have a folder for css and for images, but I dont know how to link it :S
for example /static/images/herro.jpg and /static/css/style.css
It might be like this:
@route('/static/css/')
def server_static(filename):
return static_file(filename, root='./static/css')
I think we should create another route for other folders like js, imgs, styles and so on .