Questions tagged [mako]

Mako is a template library written in Python. It provides a familiar, non-XML syntax which compiles into Python modules for maximum performance. Conceptually, Mako is an embedded Python (i.e. Python Server Page) language.

Mako is a template library written in Python. It provides a familiar, non-XML syntax which compiles into Python modules for maximum performance. Mako's syntax and API borrows from the best ideas of many others, including Django templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded Python (i.e. Python Server Page) language, which refines the familiar ideas of componentized layout and inheritance to produce one of the most straightforward and flexible models available, while also maintaining close ties to Python calling and scoping semantics.

Mako is used by the python.org website as well as reddit.com. It is the default template language included with the Pylons web framework.

422 questions
0
votes
1 answer

Python and web development | Mako - a lot of questions

Not coming from an MVC background, but just working with php purely, one of the greatest challenges was to grasp frameworks and the MVC ideology. While I am sure many adhere to MCV as the standard way to push code, I lack finding basic introductions…
0
votes
1 answer

Mako, Jinja2, Won't Install In Python 3

I'm trying to install some template languages to use with CherryPy & Python3, but they won't install. Mako & Jinja2 both install fine into Python 2, but when I try installing them for Py3, they produce errors and won't install. They give this same…
Zamphatta
  • 4,634
  • 8
  • 30
  • 34
0
votes
1 answer

using variables in place of id names in jquery

I desire to use a variable i that is incremented in a for loop to create unique id's in div's in a mako template. var i=0; % for p in row.photos: %if not p.PRIVATE: /* setup div's for photo containers*/ …
stuartz
  • 121
  • 4
  • 9
0
votes
1 answer

Python Javascript framework to use with cherrypy and Mako

I am just learning python and python web apps so please forgive my lack of knowledge. I am writing a web app in python with cherrypy + mako (+ html), and now I am diving into the javascript part of it. Honestly, the rest was already enough to…
gee
  • 13
  • 4
0
votes
2 answers

Django views and templates, including Jinja2 and Mako, tutorials and resources

I'm new to Python and Django, but now have a pretty firm understanding of basic database and back end programming. However, I am finding it hard to learn the views and templates layers. I was wondering if anyone can suggest additional tutorials and…
snakesNbronies
  • 3,619
  • 9
  • 44
  • 73
0
votes
2 answers

Pyramid url incorrectly generated, served on nginx+phusion passenger and Mako templates

Stuck with a problem involving Pyramid's request urls, where request.static_url and request.application_url are 2 identifiable suspects. The generated request urls in Pyramid somehow includes the view url when I put it on the web host, but works…
Juan Bill
  • 11
  • 2
0
votes
1 answer

Syntax error using Mako

I'm new to Python and Mako and I'm learing to use it. I've obtained the 0.7.0 version of it and have tried to import it in the interpreter and I'm getting the following error. Not sure where to go from here. >>> from mako.template import…
KumarM
  • 1,669
  • 1
  • 18
  • 26
0
votes
1 answer

UNDEFINED mako templating error

I'm using Pyramid 1.3 with Mako Templating. I have a view with a method called "create" that returns an empty dictionary to a template. I intend to use the same "create.mako" template for both creating and editing. I've put the context variable…
Mark
  • 2,137
  • 4
  • 27
  • 42
-1
votes
2 answers

What are "contexts" in Mako?

What is context in python, in particular what does **context mean? Is it a way to pass the variables in the current context around? A code example will be most appreciated. from mako.template import Template template = Template('var1 = ${var1}') for…
ganesh reddy
  • 1,842
  • 7
  • 23
  • 38
-1
votes
3 answers

Can a javascript file be dynamic (different for each client when he loads) ? How?

Each client on the site has his own composition of HTML elements. Some may have 3 elements while others may have 123. There is little if any similarity between the elements. And each element requires specific code to manipulate the various…
DKean
  • 2,017
  • 6
  • 19
  • 28
-1
votes
1 answer

Debugging mako NameError("Undefined")

Is there any way of obtaining more information about what happens when NameError("Undefined") is raised in Mako templates. In Flask-Mako there is a solution, but I'm not using flask. So I need a pure Mako solution
somenxavier
  • 1,206
  • 3
  • 20
  • 43
-1
votes
2 answers

How to solve string templates are not supported by current javascript version

I try to use the answer from my previous question Enable datatables with custom layout But I get an error message in Pycharm: "String templates are not supported by current javascript version" Do you know what I can do about it? If I replace with…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
-1
votes
1 answer

Django Error - AttributeError: 'CourseOverview' object has no attribute 'start_datetime_text'

I have been trying to get this theme working for Open edX (based on Django) and I am getting this error in supervisor logs - AttributeError: 'CourseOverview' object has no attribute 'start_datetime_text' The whole error is this - May 14 11:43:36…
Nishant Dixit
  • 543
  • 1
  • 4
  • 12
-1
votes
4 answers

remove duplicate items in list

Current code: mylist = [('x', 'Value1', 'Value2'), ('x', 'Value3', 'Value4')] for item in mylist: item[0], item[1], item[2] current for loop output: x, Value1 : Value2, x, Value3 : Value4 wanted output: x, "Value1 : Value2, Value3 :…
Emre
  • 109
  • 1
  • 10
-2
votes
2 answers

How to use python script to download JSON from the net using API

I am new with the python. Can anyone tell me how to download JSON file from given API in python and then save as HTML using mako or jinja? Use python script to download JSON from the net using the API. API to use…
1 2 3
28
29