Questions tagged as 'django'

1
answer

Query with dates using a range

I have the following query: query=Detalles.objects.filter(fecha_creacion__range=(fecha_inicio,fecha_final)) The expected result is to filter the results between date A and date B, that is: fechaA= 01-07-2018 FechaB=04-07-2018 However,...
asked by 04.07.2018 / 22:40
1
answer

Problem in urls.py

urls.py #home/urls.py from django.urls import path, re_path from home.views import homePageView, dashboardPageView, userPageView, CoinsPageView urlpatterns = [ path('',homePageView.as_view(),name='home'), re_path('activate/(?P...
asked by 09.07.2018 / 23:44
1
answer

Can I do this in python (django)?

I'm in a model and I want to get an attribute of the model, but I have the attribute as a string. It would be right to do this: self.nombre but I have this: text = "nombre" how do I access the attribute with what I have...
asked by 28.06.2018 / 05:47
1
answer

Get MAC in Django / python

I want to get the mac from a device, I'm importing: from uuid import getnode as get_mac mac = get_mac() print ('mac...>>>:',mac) However, it brings digits that do not correspond to a MAC (00: 00: 00: 00: 00: 00)     
asked by 14.06.2018 / 23:20
1
answer

Problem with authenticate (username = username, password = password) in django

I am trying to make a login for an api with django rest framework, I am guiding myself with this video: link Here is just the code I use in the login view: orders / urls: from django.urls import path, include from . import views from r...
asked by 21.06.2018 / 08:02
1
answer

ModelMultipleChoisefield with unique objects from each user Django

I have a user model that has a ManytoMany () field to another object: class PrivateWallet(models.Model): name = ... class Usuario(AbstractUser): private_wallets = models.ManyToManyField(PrivateWallet, blank=True) and I want to crea...
asked by 14.07.2018 / 22:27
1
answer

Applying Django mixins and queries with Q objects - particular behavior

I have the following mixin in which I want to recover the data from the User model with which I work to place this data in different views based on classes that I am developing: class UserProfileDataMixin(object): def get_context_da...
asked by 10.06.2018 / 08:23
1
answer

Placement in MultipleChoiceField template in Django

I'm doing a web page in Django and I want to introduce a MultipleChoiceField in a table. I want to introduce it in a personalized way, but when using the template code it does not give results. Here I leave the codes and the result. forms.p...
asked by 08.05.2018 / 08:59
2
answers

How to get page in django?

Using Django. I have info on amount of page in database this amount is entered by each user and stored in bd.  my concern is: How can I page with the amount I have stored in bd, for example, change 25 by the number I have in my database that I h...
asked by 05.05.2018 / 23:02
1
answer

Problems with the git push heroku master

Good as it is I hope that well, I am having problems to do a push to a project done in python using the django framework for heroku that can see it through this link link I get the following error:     
asked by 16.05.2018 / 14:30