Most voted "django-templates" questions
Use this tag for questions about Django’s template engine, which is intended to separate the presentation of a document from your data.
Learn more…118 questions
Sort by count of
-
0
votes1
answer18
viewsHow to use "Objects.filter" by selecting only the logged in user in the application?
I am using Django authentication and in HTML templates works very well when I use for example: {% if user.is_anonymous %} ... {% else %} ... {% endif %} I would like to use this same "user", which…
-
0
votes1
answer36
viewsDisplay a boolean field result if it is True
I’m having difficulty here to display the return of a Boolean field in the template. I need to display the field name if it is true in the template. models topo = models.BooleanField() views def…
-
0
votes1
answer18
viewsInline formsets Django
Hello, I am until that experienced in Django but I am having an error that I am not able to solve, well the error is this, I have an inlineformset_factory and when I go to save it not saved and says…
-
-1
votes1
answer58
viewsif and Is between loan
Thus, I created a user table and a business, both inherit from the Django user table. Perfect, both your users and tables. But I have a menu and a profile page.html and wanted that in this menu…
-
-1
votes1
answer26
viewsDjango Form - Status
I am working on a library administration system and at this moment I am creating the logical part to realize a loan. Here is my great doubt; How to set a state for available or unavailable book…
-
-1
votes1
answer25
viewsHow to use a custom tag within an IF tag?
Personal as I use a custom tag within an if tag? ex: {% if {%outraTag x y z %} == "Sucesso" %} my custom_field_tag @register.simple_tag def outraTag(x,y,z): r=x+y+z if r ==3: return "Sucesso" else:…
-
-1
votes1
answer322
viewsDjango: Form not saved in Django database
When I click to register the page simply refreshes and nothing is saved in the database. In the Django console I get the message: "GET /people/ HTTP/1.1" 200 898 "POST /person-add/ HTTP/1.1" 200 898…
-
-1
votes1
answer179
viewsConfirmation Modal with Django
I’m on my first project in Django and I’m having a hard time making a confirmed modal before deleting the record. When I press the YES button it does not direct to my URL {% url 'apiDelete' api.id…
-
-1
votes1
answer39
viewsJavascript does not work when I try to do more than 2 tasks
I’m early in web development. The script below only works for what I do in the first for, I don’t know what I’m doing wrong. When he should do the second part is he doesn’t even get into it. It also…
-
-1
votes1
answer203
viewsHow to create 2 Forms simultaneously in Django and configure the views
What I want to do is create 2 Forms simultaneously, on just one page 'index.html'. One would just be a normal form that will send a message to contact, and the other is a record that I need to save…
-
-1
votes1
answer50
viewsDjango: Template not found :(
Good afternoon, you guys! I’m creating a url that will update the information sent in the form. I never worked with a url that pulled an id, and now I’m getting an error that Templatedoesnotexist…
-
-1
votes1
answer55
viewsHow to Make the following function in pure javascript?
I would like to make the following calculation: take the amount of value to pay,take the value of the days of delay and that when clicking the confirm button do the following calculation:…
-
-1
votes2
answers107
viewsHow to filter choices from a field based on choices from another form field in Django?
In Django Admin I have a model who has two fields: Unidade and Localizacao. Where Unidade has a ManyToManyField for Localizacao, as follows below class Unidade(models.): nome =…
javascript python django django-templates django-adminasked 3 years, 8 months ago Leonardo Furtado 144 -
-1
votes1
answer34
viewsRender JSON Django field
I am doing a project using Django 3.1.2, this project needs a log. I created a template for logs: class Log(models.Model): Usuario = models.CharField('Usuário que fez a ação', max_length=100) Perfil…
-
-1
votes0
answers9
viewspermissions in the Django template
I’m trying to create a permission in the Django template but I couldn’t. Wanted to set in the template only professional users to view a button. This is the professional model I’m creating. class…
-
-2
votes1
answer62
viewsWhere should the mediafiles directory be in the Django configuration to be able to download the files on the Heroku server (free app)?
After uploading the file for hours I can download the files, but after a while I can not download the files, saying that the file does not exist, only when I consult the database and the table by…
-
-2
votes2
answers29
viewsShow only second field of the field choises
In my model I have an option list and when I display it in the template it appears like this: "("D", "Slow")" and I would like it to be displayed only "("Slow down")". Currently As it should be…
-
-3
votes1
answer44
viewscomp make that a variable of a database has the total of records that another bank owns?
opa, me nome antonio, I’m starting in December, I’m creating an application where I need the totmatérias attribute of the table "Writer" to have the number of news written by that writer that is…
python python-3.x django web-application django-templatesasked 3 years, 7 months ago Antonio Pacheco 27