django-templates Questions
2
Solved
My settings.py has USE_THOUSAND_SEPARATOR = True because that's generally what I want in my templates.
However, what can I do to prevent this default behaviour for only one of my variables in a tem...
Clarindaclarine asked 3/7, 2020 at 18:55
10
Solved
Server returned
TemplateSyntaxError at /
Invalid block tag: 'static'
on this line: <img src="{% static 'icon/logo.png' %}">.
The whold html file is like this (it's an html file {% include %...
Anglicanism asked 11/1, 2015 at 11:23
3
I keep seeing:
DEBUG Exception while resolving variable 'exception_type' in template 'unknown'.
In my django logs, followed by:
VariableDoesNotExist: Failed lookup for key [exception_type] in
fol...
Chloe asked 27/4, 2017 at 17:0
5
Solved
This may be simple, but I looked around and couldn't find an answer. What's the best way to reference a single item in a list from a Django template?
In other words, how do I do the equivalent of {...
Thyrse asked 10/1, 2011 at 20:27
14
I am using Vuejs and I keep getting this warning in the console. Also no data is loaded because of this warning. I checked the code for unwanted tags but did not find any.
Is this because of the j...
Smythe asked 30/6, 2016 at 9:31
5
Solved
I want to achieve multiplication operation in django template. For example
I have the values,
price=10.50
quantity=3
With the help of this link
http://slacy.com/blog/2010/07/using-djangos-widthrati...
Grizzly asked 21/8, 2013 at 6:51
12
Solved
I have dates in ISO 8601 format in the database, %Y-%m-%d. However, when the date is passed on to the template, it comes out as something like Oct. 16, 2011.
Is there a way that I can manipul...
Bridgid asked 12/10, 2011 at 8:22
4
Solved
In models:
class Getdata(models.Model):
title = models.CharField(max_length=255)
state = models.CharField(max_length=2, choices=STATE, default="0")
name = models.ForeignKey(School)
created_by ...
Placentation asked 16/6, 2010 at 11:58
6
Solved
I'm currently migrating all the static files references in my project to the new {% static %} tag that django 1.5 introduced, but I'm having a problem, in some places I use variables to get the con...
Slippage asked 20/5, 2013 at 18:24
3
Solved
I have a template in django called base.html that is calling another template through the {% include 'gui/page.html' %}
in that template I have the following javascript which allows the ability to...
Sprag asked 18/11, 2015 at 3:50
5
Solved
This is my base.html
<!DOCTYPE html>
<head>
<title> My Site </title>
</head>
<body>
<div id="wrapper">
<!-- HEADER START -->
{% block nav %} {% ...
Area asked 31/12, 2011 at 14:12
4
models.py:
class Person(models.Model):
name = models.CharField(max_length=200)
CATEGORY_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
gender = models.CharField(max_length=200, choices=CATEGO...
Earpiece asked 1/12, 2010 at 2:25
2
Solved
I'm junior backend dev. I don't know how to use JS.
I can't set
<input type="checkbox" name="player_check">
true...
or reverse i can't set
<input type="checkbox" name="player_chec...
Mincing asked 13/7, 2018 at 8:13
5
Solved
I'm new with django. I'm stuck with the problem of comparing string in the template.
I have use ifnotequal tag to compare string. But it is not working.
I have try to output the variable:
{{ req...
Malocclusion asked 1/6, 2012 at 6:56
4
Solved
I am using django-pagination to paginate my object list. It is working flawlessly. I want to give a number to each object on the page and I am using {{forloop.counter}} for that, but the problem is...
Bistre asked 21/2, 2012 at 7:7
4
Solved
I have looked every where possible, I have not found the answer to the issue I'm having. I spent hours in this and find not avail.
My front end was displaying all images and css with a static fold...
Jeth asked 22/10, 2016 at 22:57
5
Solved
How can I change the width of a textarea form element if I used ModelForm to create it?
Here is my product class:
class ProductForm(ModelForm):
long_desc = forms.CharField(widget=forms.Textarea)...
Farkas asked 21/9, 2008 at 6:15
2
Solved
Am using Django Authentication Model.
The problem is when i visit /accounts/login, i get TemplateDoesNotExist: registration/login.html error message. Now the problem is i already specified a templa...
Motherwell asked 7/7, 2018 at 17:13
4
Solved
I'm passing the request to the template page.In django template how to pass the last page from which the new page was initialised.Instead of history.go(-1) i need to use this
{{request.http refere...
Tropophilous asked 10/12, 2010 at 6:43
7
I have form field {{form.item}} which will render to
<input type="text" name="item" >
How can i change the name attribute of the form field using custom template tags?
I tried by sendin...
Seaplane asked 14/8, 2012 at 6:39
1
Solved
I have two main usage and main model pages, in which products from a specific usage or model are listed.
I have the following views for these pages:
def get_common_queryset():
usage_queryset = Usa...
Adamis asked 12/12, 2022 at 8:17
1
Solved
NOTE: This question is not about creating or using a base template!
I'm creating a products app in my project, using only django and html/css, and all pages in this part has a sidebar nav menu that...
Michail asked 7/12, 2022 at 7:47
4
Solved
My dictionary looks like this(Dictionary within a dictionary):
{'0': {
'chosen_unit': <Unit: Kg>,
'cost': Decimal('10.0000'),
'unit__name_abbrev': u'G',
'supplier__supplier': u"Steve's M...
Shayne asked 5/11, 2011 at 8:8
1
Solved
I need to pass a json object to a javascript script in Django. I used the method described here:
Django: passing JSON from view to template
Here is my view:
def test_json(request):
data = {}
dat...
Jubilee asked 24/11, 2022 at 16:29
4
Solved
I am trying to create a blog o django where the admin posts blogs from the admin site.
I have given a TextField for the content and now want to give a new line.
I have tried using \n but it doesn't...
Kirkman asked 10/5, 2016 at 8:42
© 2022 - 2024 — McMap. All rights reserved.