Mako

Mako is a template engine built in Python that is used to generate output HTML, XML and similar formats.

Mako template engine logo.

Mako is an implementation of the template engines concept. Learn more in the web development chapter or view the table of contents for all topics.

Mako resources

  • Exploring Mako explains a bit about the template engines Myghty and Mason, which influenced Mako's design. The post then shows a few basic examples for how to use Mako.

  • Configuration Templates with Python and Mako shows some basic situations for how to use Mako in an example project.

  • The Pylons' project documentation on templates provides many examples for using Mako, which is the default template language for the Pylons web framework.

  • Flask-Mako is a Flask extension that makes it easier to use Mako as the template engine in your Flask web app projects.

  • The Stack Overflow question on What is the fastest template system for Python? provides some basic benchmarks comparing Mako, Jinja and other template engines. Any benchmark should be taken as a data point rather than a rule on which engine is actually the fastest in real world scenarios. In addition, if you are using Mako or any other template engine as part of a static website generator then it will not really matter which one is the fastest because the output is created before the website is deployed rather than during the web server's HTTP request-response cycle.

Learn more about template engines or another topic?

What are template engines and why are they useful?

I want to learn how to code a Python web application using a framework.

I've built a Python web app, now how do I deploy it?

Sign up for two emails per month with Python tutorials and Full Stack Python updates.

Full Stack Python

Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.
Updates via newsletter, Twitter & Facebook.
1. IntroductionLearning ProgrammingWhy Use Python?Python 2 or 3?Enterprise PythonPython CommunityCompanies using PythonBest Python ResourcesBest Python VideosBest Python Podcasts2. Development EnvironmentsText Editors & IDEsVimEmacsSublime TextPyCharmJupyter NotebookBash shellShellsZshPowerShellTerminal MultiplexerstmuxScreenPymuxEnvironment configurationApplication DependenciesSource ControlGitMercurialApache SubversionHosted Source ControlGitHubBitBucketGitLab3. Core LanguageGeneratorsComprehensions4. TestingUnit TestingIntegration TestingCode MetricsDebuggingLoggingMarkdown6. Security7. Web DevelopmentWeb FrameworksDjangoFlaskBottlePyramidFalconMorepathSanicOther Web FrameworksTemplate EnginesJinja2MakoDjango TemplatesWeb DesignCascading Style Sheets (CSS)HTMLResponsive DesignMinificationBootstrapJavaScriptTask QueuesCeleryRedis Queue (RQ)DramatiqStatic Site GeneratorsPelicanLektorMkDocsWebSocketsuvloop8. DeploymentServersStatic ContentPlatform-as-a-ServiceVirtual Private ServersOperating SystemsUbuntuWeb ServersApache HTTP ServerNginxCaddyWSGI ServersGreen Unicorn (Gunicorn)Continuous IntegrationJenkinsConfiguration ManagementAnsibleDockerServerlessAWS LambdaGoogle Cloud Functions9. DataRelational DatabasesPostgreSQLMySQLSQLiteObject-relational MappersSQLAlchemyPeeweeDjango ORMSQLObjectPony ORMNoSQL Data StoresRedisMongoDBApache CassandraNeo4jData analysispandasBokehd3.jsMatplotlib10. Web APIsMicroservicesBotsAPI CreationAPI IntegrationTwilio11. DevOpsMonitoringCachingRollbarWeb Analytics12. Change LogWhat Full Stack MeansAbout the AuthorFuture DirectionsPage Statuses ...or view all topics.

Matt Makai 2012-2018