Questions tagged as 'django-templates'

1
answer

Javascript variable in the Django template

But I'm not sure how to do that. Example of what I want to do: <!DOCTYPE html> <html> <body> <script> let showMessage = false; </script> {% if showMessage %}...
asked by 24.10.2018 / 22:52
0
answers

Delete item from list in tempate

Hello, I have a template that shows me the items I want to donate and a final step where I confirm or delete any of these items views.py def confirm_donation(request, id): donation = get_donation(id, request.user) if n...
asked by 09.10.2018 / 18:40
2
answers

Use {% for%} and {% if%} in Django template

I have 3 videos saved in the Postgres database where I set a star_date and the video only appears in the template when start_date <= date.today() My problem is in template . I have 3 buttons, one for each video, my idea is...
asked by 02.10.2018 / 19:22
1
answer

I can not access a url, either full or slug

I'm doing a Django course that uses a simplemooc platform as a study, but I stopped in a class when trying to access the details of the course that is in a separate url in a dynamic list, there is no change in the page, courses without any chang...
asked by 29.07.2018 / 20:24
1
answer

Django datetimefield as text

I am creating an application in django where I will have a form for creating a query schedule, my model looks like this: class Agenda(models.Model): """Criação da agenda de consultas da Clinica""" data_consulta = models.DateTimeField() pacient...
asked by 18.07.2018 / 16:49
1
answer

Variable of context processors does not work with render_to_string

In some places on my system, I render a page with render_to_string , because I want to render only a small content. In these cases I do not get my variables that I created in context_processors . Does anyone have a solution other tha...
asked by 05.07.2018 / 01:00
0
answers

Form Data Listing - Django

Good evening! I have an evaluation form created in Django 2.0.4, in which 3 questions are inserted along with their answers, however, when listing the result on a page only the last question and answer is listed.     
asked by 15.06.2018 / 23:32
1
answer

Django 2 nonexistent Template

In my project I have a project with 2 apps. The first app is learning_logs that has a template, base.html The second app is users, I'm trying to use the learning_logs template in users as follows: {% extends "learning_logs/base.html" %} It...
asked by 20.04.2018 / 00:47
0
answers

How to receive the username of the logged in user when sending a message through REST?

The intention of this project is to make a Chat Room. I have 2 tables, Django's predefined User table and Message table, where messages sent by users are stored. I want a user to send a message, via a form sent to the table by the sendMessage...
asked by 19.02.2018 / 03:06
0
answers

I need to include data from a list in a Django form as Default

I want to display a form in the template already with the variables {{n}} of a list. How to do? {% if forloop.counter == 3 %} {% for n in campos %} {% if forloop.counter == 3 %} <div class="form-group{% if field.error...
asked by 20.01.2018 / 20:28