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

КОМЕНТАРІ • 27

  • @MohamedAshraf-zs6nv
    @MohamedAshraf-zs6nv 3 роки тому

    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

  • @TomasDeMatteis
    @TomasDeMatteis 7 років тому

    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!

    • @prettyprinted
      @prettyprinted  7 років тому

      I'm glad it helped. Thanks for watching!

  • @thomasedwardking7286
    @thomasedwardking7286 2 роки тому +2

    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 😅

  • @juanarizpe8197
    @juanarizpe8197 3 роки тому

    Great videos!! Wished you would have kept making them

  • @FelipeSamuel
    @FelipeSamuel 7 років тому

    Seus vídeos são ótimos! Obrigado por falar sobre bottle

  • @jwilliams8210
    @jwilliams8210 3 роки тому

    You rock!

  • @mohammadghonchesefidi9238
    @mohammadghonchesefidi9238 6 років тому

    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?

  • @felixurbina4
    @felixurbina4 3 роки тому

    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.

  • @deepakpoul2030
    @deepakpoul2030 6 років тому

    Thanks a lot 😘😘😘

  • @Mezklador
    @Mezklador 7 років тому +1

    I'm really curious about Bottle. So more tutorial about it, please!

    • @prettyprinted
      @prettyprinted  7 років тому

      I do have a Bottle playlist: ua-cam.com/play/PLXmMXHVSvS-AyIwEYkGNa4WE1AR1_45mv.html
      I'll definitely make more videos in the future.

  • @vic_shine
    @vic_shine 7 років тому

    Very need tutorial for make user register/login on Bottle ;) I know, you more liked Flask, but anyway.. please continue lessons for Bottle..

  • @Canda-fh4xc
    @Canda-fh4xc 6 років тому

    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.

  • @bernardrouhi451
    @bernardrouhi451 7 років тому

    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.

    • @prettyprinted
      @prettyprinted  7 років тому

      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:

    • @bernardrouhi451
      @bernardrouhi451 7 років тому +1

      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.

    • @t0binho
      @t0binho 7 років тому

      try: (with the dot for working directory -> ./static...)

  • @sundz5899
    @sundz5899 7 років тому

    in myfiles i'd like to have and extra map called images but I cannot do that, any tips?

    • @prettyprinted
      @prettyprinted  7 років тому

      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?

    • @sundz5899
      @sundz5899 7 років тому

      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

  • @mohammadghonchesefidi9238
    @mohammadghonchesefidi9238 6 років тому

    It might be like this:
    @route('/static/css/')
    def server_static(filename):
    return static_file(filename, root='./static/css')

  • @mohammadghonchesefidi9238
    @mohammadghonchesefidi9238 6 років тому

    I think we should create another route for other folders like js, imgs, styles and so on .