Questions tagged as 'django'

1
answer

get the sum of an attribute django models

Good morning: I have a model Order and I need general a summary of all the orders that have been generated in the last 15 days, then I want to generate the total of all the orders and I do not know how to do it. for the moment I have this: ped...
asked by 18.01.2018 / 09:48
1
answer

view based on django functions

I am making progress in the development of django with an application, initially with the use of function-based views, my idea is also to handle views based on classes, and I am with an application that allows me to recover a record from a table...
asked by 13.12.2017 / 19:50
2
answers

Adding a home page with django

I have my application in django and I want to add a new page called homepage.html so in my project called web in the views.py I added: def homepage(request): return render_to_response('homepage.html', context_instance=RequestCo...
asked by 15.11.2017 / 18:52
1
answer

How to send data in a GET request when doing unit tests in Django?

I am working on the backend of a web application using Django and Django Restframework. I have several viewsets defined according to the models that are handled and to which several requests are made ( GET, PUT, DELETE, POST ). I have done se...
asked by 25.01.2018 / 15:31
1
answer

Pages not found Django

I have a project halfway and I was adding some new pages, but when trying to access it tells me the following: Using the URLconf defined in authtest.urls, Django tried these URL patterns, in this order: ^admin/ ^$ [name='home'] ^resolutividad/...
asked by 26.10.2017 / 18:05
1
answer

Adding "SITE_ID = 1" Error

Someone knows how to fix this error in Django    You're using the Django "sites framework" without having the set   SITE_ID setting. Create a site in your database and set the SITE_ID   setting to fix this error.     
asked by 01.06.2017 / 17:13
1
answer

How to send a message to a gmail account from DJango

You see, I have created a view with which a person can send a message to an email address. I already have it ready, but there are a couple of failures: The first, although some factors, such as to which email address the message should be sent,...
asked by 15.05.2017 / 15:31
2
answers

Validation of the fields in Django

I would like to modify some of the fields in my form to be validated but I do not know how. I know there are several methods but I do not understand them, if you can help me, thank you. This is my forms.py : from django import forms from d...
asked by 05.09.2018 / 20:35
1
answer

Iterate a list in Django

I have a model called Precompra and from there I am interested in the price to calculate the total for now. What is the problem with this code that is not showing me the result in the template. This code was programmed in view.py...
asked by 13.04.2017 / 17:48
1
answer

How to make a multiple select in django

Good evening I need to implement a multiple select in django and store the selected options in the model. I appreciate the ideas that you give me since I am in need of this functionality.     
asked by 28.02.2017 / 03:27