Mako Templating Engine - Pinpoint #17

Поделиться
HTML-код
  • Опубликовано: 11 янв 2021
  • If you're a Python/Flask user, you may find the default jinja2 templates lacking in that you cannot write arbitrary Python code within the template.
    While it is a generally good idea to separate your template and your program logic, it is not always possible to do so. Luckily, Mako comes to the rescue! Mako acts as a drop-in replacement to Jinja2, while at the same time allowing you to use ANY Python code in your template!
    NB: If you have many routes, the try/except method might be difficult. Check the code repository download for an alternative method!
    = REFERENCES =
    Thanks to Ford on StackOverflow for finding an undocumented configuration flag to make Mako display errors better: stackoverflow.com/questions/3...
    = CODE DOWNLOAD =
    To view and download the code written in this video, check out the following Bitbucket repository: bitbucket.org/nerdfirst/flask...
    To download, first click on "Downloads" in the left sidebar. Then, in the subsequent page, click "Download Repository".
    = 0612 TV =
    0612 TV, a sub-project of NERDfirst.net, is an educational RUclips channel. Started in 2008, we have now covered a wide range of topics, from areas such as Programming, Algorithms and Computing Theories, Computer Graphics, Photography, and Specialized Guides for using software such as FFMPEG, Deshaker, GIMP and more!
    Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!
    Like what you see? Buy me a coffee → www.nerdfirst.net/donate/
    0612 TV Official Writeup: nerdfirst.net/0612tv
    More about me: about.me/lcc0612
    Official Twitter: / 0612tv
    = NERDfirst =
    NERDfirst is a project allowing me to go above and beyond RUclips videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.
    Watch this space, and keep your eyes peeled on this channel for more updates! nerdfirst.net/
    -----
    Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.

Комментарии • 6

  • @BrittanyLHernandez
    @BrittanyLHernandez Год назад

    This is helpful, thank you!

    • @NERDfirst
      @NERDfirst  Год назад +1

      You're welcome! Glad to be of help =)

  • @ryansossou646
    @ryansossou646 2 года назад

    really helpful, thanks for shared

    • @NERDfirst
      @NERDfirst  2 года назад

      You're welcome! Glad to be of help =)

  • @Arthur-hi3tc
    @Arthur-hi3tc Год назад

    Great video

    • @NERDfirst
      @NERDfirst  Год назад +1

      Hello and thank you for your comment! Glad you liked the video =)