|
Hi, I found a link to have a 'switch' tag in Django templates, but I was wondering if this can be somehow achieved without it. Using only the stuff which comes with Django? Basically is there other way then using multiple 'if' or 'ifequal' statements?...
Started by Czlowiekwidmo on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You'll have to write enough to accomplish what you want this is a sign that the code should be moved into Django view instead of in the template.
Unfortunately, this is not possible with the default Django template engine.
|
|
I want to use the Django template engine in my (Python) code, but I'm not building a Django-based web site. How do I use it without having a settings.py file (and others) and having to set the DJANGO_SETTINGS_MODULE environment variable?
If I run the ...
Started by Daryl Spitzer on
, 10 posts
by 10 people.
Answer Snippets (Read the full thread at stackoverflow):
I think they're working on making....
Jinja 2 is a pretty good superset of Django templates for general use.
Any particular reason you want to use Django's templates? Both Jinja and Genshi are, in my opinion the above statements.
|
|
Hello,
Is there a tool out there for visually building Django templates?
Thanks
Started by Rax Olgud on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For....
I've read that TextMate has a "Django bundle" for editing code and templates if you're on a Mac templates.
There's also netbeans.
templates, and the page I linked claims support for Django template editing.
|
Ask your Facebook Friends
|
What is the best location to put templates in django project?
Started by Vishal on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
From the Django book, chapter 4 :
If you can’t think of an obvious place to put your templates, we recommend creating a templates directory within your Django project (i.e., within the mysite my CSS/JS/images etc
/templates....
|
|
Does something like the python
if "a" in ["a", "b", "c"]: pass
exist in Django templates?
If not, is there an easy way to implement it?
Started by Ian P on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Without more context about.
This is not typically something needed inside the templates themselves.
|
|
How do I do a if a in list_b test in Django 0.96 Templates?
I'm having a list of checkboxes and a variable containing a list of corresponding values from a previous submit of the checkboxes.
Now I want to set all checkboxes in the list to checked="checked...
Started by Johan Carlsson on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You could also just use jQuery or a similar Javascript library which is more suited for DOM scripting ... .
You need to write a custom template tag Django's forms framework.
It's not possible in any version of Django templates.
|
|
How do I write a numeric for loop in a Django template? I mean something like
for i = 1 to n
Started by Lev on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Unfortunately, that's not supported in the Django template language.
Be available to your templates and template authors, without having to explicitly pass a valid range through your view code.
|
|
After reading the Jinja2 documentation, I'm interested in employing it in future Django projects. However, I'm wondering if anyone has encountered any drawbacks or gotchas when using Jinja2 templates with Django? If so, how did you work around them?
I...
Started by Soviut on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Is tightly coupled to Django templates The default views and decorators that come with the Auth app (and elsewhere) are coupled to Django templates, so you may have to duplicate the effort if you want to use your Jinja2 ....
|
|
One of the things I find myself doing often is passing string literals as parameters to template tags or functions; for instance:
{% url my-url 'my_param' %}
Unfortunately, the django template engine doesn't let you do this. So I find myself doing this...
Started by pjbeardsley on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The Django {% %} material is simply pulled out of the HTML without.
They do.
Seem like they should work.
|
|
Hello,
I am wondering if someone can help me figure out the best approach to the following problem. I'm building a web application which uses Django templating to construct its web UI component. There are a number of common HTML elements such as the header...
Started by Matty on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You could make a template, called; This overrides the content block....
Say you had a header and footer.
Http://docs.djangoproject.com/en/dev/ref/templates/builtins/#include
You can use django's extends tag.
Try the {% include %} tag.
|