django-templates Questions
23
Solved
here is my site url http://webtrick.heliohost.org/
my template directory settings:
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__) , 'templates').replace('\\','/')
)
view.py
from djan...
Tartarean asked 16/4, 2011 at 11:3
10
Solved
I'm tooling around with Django and I'm wondering if there is a simple way to create a "back" link to the previous page using the template system.
I figure that in the worst case I can get this inf...
Outgrowth asked 8/2, 2009 at 2:2
2
Solved
this works:
{% get_option 'payment_conditions' '' true %}
It calls a function with 3 parameters and it returns a string: "I am the conditions". Great.
What I want to do now is to put this in a ...
Ambrosane asked 24/8, 2015 at 12:16
9
I know the automatic setting is to have any models you define in models.py become database tables.
I am trying to define models that won't be tables. They need to store dynamic data (that we get a...
Kailey asked 1/2, 2012 at 5:40
1
Solved
I have a view that is part of a page, I am using HTMX to update this view multiple times (each time is a new question, the user answers, then the next question is shown). The rest of the page does ...
Animadversion asked 28/11, 2023 at 18:0
6
Solved
I am getting the error:
'str' object has no attribute 'META'
The Traceback highlights this bit of code:
return render('login.html', c)
Where that bit of code is in my views.py:
from django.short...
Calculus asked 18/11, 2013 at 10:12
15
Solved
I'm following this tutorial on a Windows 7 environment.
My settings file has this definition:
TEMPLATE_DIRS = (
'C:/django-project/myapp/mytemplates/admin'
)
I got the base_template from the temp...
Columbia asked 14/6, 2010 at 15:24
6
Solved
After upgrading to Django 3.0, I get the following TemplateSyntaxError:
In template /Users/alasdair//myproject/myapp/templates/index.html, error at line 1
'staticfiles' is not a registered tag lib...
Krefetz asked 30/4, 2019 at 22:31
3
Solved
I want to check whether the message tag are INFO ?
How to check that in the template file?
I tried this but it didn't work:
{% if messages %}
<ul>
{% for message in messages %}
<li&g...
Truncation asked 23/5, 2013 at 10:46
2
Solved
I have a html table with duplicate data in the column as shown below
I want to dynamically merge the html table row cell if the data is same like below table
I am able to do this with giving ...
Flounce asked 20/11, 2013 at 10:42
2
Solved
how I can django replace html href and src to a static tag in Pycharm?
For example:
<link rel="stylesheet" href="libs/owlcarousel/assets/owl.carousel.min.css">
<a href="/"><img src=...
Hindquarter asked 22/7, 2018 at 18:56
4
Solved
I am trying to create a formset to save records in a go. But, I keep getting the error when I submit my form. And if possible please as tell me how should I save my batch of records.
My views.py:
...
Bb asked 15/8, 2014 at 17:50
5
Solved
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...
Longdistance asked 7/4, 2009 at 13:43
12
I've created a custom tag that I want to use, but Django can't seem to find it. My templatetags directory is set up like this:
pygmentize.py
from pygments import highlight
from pygments.lexers ...
President asked 28/1, 2016 at 6:26
2
Solved
How can one present current data and time in django's template?
Ingathering asked 14/4, 2015 at 21:31
7
Problem:
{% extends 'base.html' %} {% block title %} Dashboard {% endblock %} {% block pagetitle %}
becomes
{% extends 'base.html' %} {% block title %} Dashboard {% endblock %} {% block
pagetitle ...
Sur asked 11/11, 2020 at 11:49
5
Suppose the parameter I want to pass is called printdata, and printdata=['a', 'b', 'c'].
I use "input type="hidden" name="alist" value={{printdata}}>" to pass
the parameter. However, when I try...
Solubilize asked 2/1, 2011 at 23:28
3
Solved
I want to be able to access a bit of information that someone places in a GET variable right in the template of a page (HTML escaped, of course.) How would I go about doing this? I know you can gra...
Applied asked 15/12, 2012 at 18:54
32
Solved
My local machine is running Python 2.5 and Nginx on Ubuntu 8.10, with Django builded from latest development trunk.
For every URL I request, it throws:
TemplateDoesNotExist at /appname/path app...
Reyreyes asked 18/12, 2009 at 3:12
2
Solved
Is it correct to say that there is no simple tag that just writes some http get
query parameter?
If all needed is printing a http get query parameter e.g. ?q=w
can I directly use the value q with a...
Lashawnda asked 25/10, 2010 at 8:20
6
Solved
I have a base template file (base.html) and every other template extends to it and generates content using its blocks. Certain variables, such as nav_obj, are used in the base template file.
View:...
Crookes asked 8/2, 2010 at 17:15
12
Solved
If fruits is the list ['apples', 'oranges', 'pears'],
is there a quick way using django template tags to produce "apples, oranges, and pears"?
I know it's not difficult to do this using a loop an...
Adhesion asked 6/8, 2009 at 1:50
5
Solved
If I have a class based view, like this,
class SomeView (View):
response_template='some_template.html'
var1 = 0
var2 = 1
def get(self, request, *args, **kwargs):
return render_to_response(s...
Headstall asked 14/8, 2013 at 13:18
2
It seems like the 'with' tag is not working if it is declared outside of a block as this:
{% extends 'base.html' %}
{% with my_var=1 %}
{% block test1 %}
{{my_var}}
{% endblock %}
{% block test2...
Grisham asked 15/7, 2013 at 18:50
2
I am writing a Django app and I use the following configuration in VSCode (settings.json) to auto-format my Python code (I use the Django VSCode extension as well):
{
"liveshare.authenticatio...
Hendricks asked 3/1, 2022 at 19:2
© 2022 - 2024 — McMap. All rights reserved.