Тёмный

Mako Templating Engine - Pinpoint #17 

0612 TV w/ NERDfirst
Подписаться 59 тыс.
Просмотров 3,3 тыс.
50% 1

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 RU-vid 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 RU-vid 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.

Опубликовано:

 

11 янв 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@BrittanyLHernandez
@BrittanyLHernandez Год назад
This is helpful, thank you!
@NERDfirst
@NERDfirst Год назад
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 Год назад
Hello and thank you for your comment! Glad you liked the video =)
Далее
Introduction to Jinja Templating
17:03
Просмотров 30 тыс.
Unlocking your CPU cores in Python (multiprocessing)
12:16
How I'd Learn AI (If I Had to Start Over)
15:04
Просмотров 758 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 389 тыс.
How to Reason about Recursion
39:38
Просмотров 1,9 тыс.
Python AST Parsing and Custom Linting
11:24
Просмотров 43 тыс.
Java Is Better Than Rust
42:14
Просмотров 153 тыс.
Pull Up/Down Resistors
6:42
Просмотров 7 тыс.
The Algorithm Behind Spell Checkers
13:02
Просмотров 409 тыс.