Questions tagged as 'django'

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
0
answers

Validate form in Django

I need to do a validation from the save method, and since it is a college activity, I need to pass the unit tests, however, I am having difficulty in the last test, in which I have to validate if a student is not enrolling in a repeated discipli...
asked by 11.10.2018 / 13:10
0
answers

Problem integrating Ajax with Django code

I was making a code which reads a weather forecast and shows the value on a web platform, and the value is updated after a certain amount of time without needing to refresh the page. I was trying to accomplish in django, but I'm having trouble i...
asked by 18.09.2018 / 02:58
0
answers

M2M loading too slow in django

In some tables I use many to many, and as the database has grown its load time is increasing (of course), I've got an alternative to loading, which is raw_id_fields, but it does not demand as desired, if the raw id displayed the "name" instead o...
asked by 18.09.2018 / 17:13
0
answers

Template image does not upload

Hello, I'm developing an app that requires the user to upload their profile image, but the 'upload_to' mechanism of the CustomUser ft field is apparently not working. The image simply does not go to the intended folder, nor does it create the fo...
asked by 14.09.2018 / 21:39
0
answers

Django: TypeError: 'sslmode' is an invalid keyword argument for this function

Error executing python manage.py runserver: Virtual env python 3.7.0 or 3.6.6 django 2.1.1 or 2.0 System check identified no issues (0 silenced). Unhandled exception in thread started by .wrapper at 0x000001BC0DC7FF28 > Traceback (most...
asked by 18.09.2018 / 20:12
1
answer

Show modal only if there is an active session

When someone registers your name and email I create a session and render the page with the name of who registered, but I can not understand how I do it so that the time I render the page again appears a modal . views.py: from django.sho...
asked by 19.09.2018 / 16:04
0
answers

Find multiple values in database using django / python

I have a question a little hard to explain: I need to do some database queries and the data is structured in the following way: Alias table: SELECT id, alias_type, alias_value, individual_id FROM 'snpdb_alias' (84, 'ID_ASSOC', 'PMGS0001'...
asked by 10.09.2018 / 17:30
0
answers

Applying QuerySets to the data and returning the result of this querySet to the table (django.tables2)

Hello! I'm new to Django and am having a big question: I have following an "Event" model, and a view that is composed of a form (which I use to apply a filter to the data) and a table (where data is loaded ). Well my question is: I want to group...
asked by 06.09.2018 / 20:48
0
answers

Capturing a value using Select with Django

Good morning. I created a form and entered the names of my clients in a select. When selecting one of them I would like to do a filter but it is not working, it seems that the value of the selected field is not being sent to the view. Follow...
asked by 07.09.2018 / 15:39