I wanted to sort DateTimeField just by date, ignoring the time.
Because in my ordering I need
Person.objects.order_by('-date_joined', 'full_name')
But sorting by name has no effect because the field has time, but I just...
Assuming that I'm already using the django.contrib.auth.tokens.default_token_generator
generating tokens to reset a user's password, and
want to use the same method to activate the user, or for any other similar service, are there any o...
I have a problem with Python/Django . The school and school_application_info tables are related. However, there is no record with some school_id in school_application_info . So I added null=True, blank=True...
I'm having a problem when using request.post('url', data) , for some reason when the server receives this request, it redirects (301) the request to the same url by losing the POST data, ending as a GET method.
Python:
>>>...
DJANGO: Could anyone help me put email template (pull some html or css to email content) through views.py? I tried everything but it did not work, grateful already.
Views.py:
- - coding: utf-8 - -
from django.shortcuts import render
f...
I'm running a test in Django with just two querys and in the timer it's taking 1 min and 10 seconds to finalize the test. Is there a setting I can adjust to speed up testing?
I'm currently using postgresql in the project database.
My question is regarding the implementation of buttons in any template. I want to click this button and do something, such as displaying a message on the screen. How can I do this? Here is an image of my application that I want to add an "exit"...
I created a file called const.py (where I have the choices I'll call in models) as follows:
const.py
FORENSIC_TRAFFIC_LIGHTING = (
(u'1', u'Boa'),
(u'2', u'Ruim'),
(u'3', u'Ausente'),
)
models.py
class ForensicTraffic(m...
I wanted to make the following list into a dictionary:
lists.py
status_list = (
('c', 'cancelado'),
('elab', 'em elaboração'),
('p', 'pendente'),
('co', 'concluido'),
('a', 'aprovado')
)
So I did the following:...