Questions tagged as 'django'

1
answer

Create an own User Model and authenticate the entry

Good morning, create my own user model in Django and the idea is to use it to validate the login to the system without using the model.user that Django has by default. How can I do so that users can login to my system?     
asked by 13.01.2017 / 15:33
1
answer

Django 1.10, make an update every time an item is searched

I am trying to make an attribute increment by 1 every time I search for an item in the database. For example: criterio = "Alberto" resultado = Personas.objects.filter(nombre = criterio) for persona in resultado: persona.coincidencias += 1...
asked by 03.01.2017 / 15:22
2
answers

Django: show all the variables in a template

I have the following function that returns a JSON: class HotelService(models.Model): def get_avail_and_rates(self, rq): cabeceras = { 'Content-Type': 'application/json', 'action': 'getavailandrates',...
asked by 26.10.2016 / 11:04
2
answers

Can not assign "'1'": "Customer.type_client" must be to "Customer_type" instance

I am trying to save the form I made in django which has a foreignkey from the client model to the client type model but at the time of saving this error comes out.    Can not assign "'1'": "Customer.type_client" must be to "Customer_type"   i...
asked by 30.10.2016 / 19:39
1
answer

How to download a file uploaded using a form using FileField

in my model I use a field of type FileField to upload a file using a form. The model is as follows: from django.db import models from apps.agenda.models import TimeStampModel class Evidencia(TimeStampModel): Temas= models.TextFiel...
asked by 11.05.2016 / 03:26
2
answers

Error implementing Django REST Framework

I have the project on the production server, and I'm passing certain scripts from a local project to the server. And it gives me an error that I can not isolate. ImportError at / No module named viewsets Request Method: GET Request URL: htt...
asked by 11.05.2016 / 13:56
1
answer

TypeError: string indices must be integers - Saving data from a JSON to the database

I have the following situation: The model RehabilitationSession in addition to other data these fields of interest: class RehabilitationSession(models.Model): ... minimum = models.DecimalField( max_digits=5,d...
asked by 17.11.2016 / 03:13
1
answer

In the file.conf shows Error using Supervisor, in digital ocean, any option to correct it?

When configuring the file.conf path: sudo nano /etc/supervisor/conf.d/facturaempresa.conf [program:facturaempresa] command=/home/user/bin/gunicorn_start user=user autostart=true autorestart=true redirect_stderr=true stdout_logfile=/home/user/...
asked by 03.01.2019 / 05:09
2
answers

Django and autocomplete, How can I search by First and Last Name?

I have the following code that only searches for the name of person, I can not think of how to search also by last name, here I leave the code to try to search by last name but it does not work does not search views.py def Buscarpersona(req...
asked by 10.12.2018 / 00:12
1
answer

How to display a menu only for users of a group in Django?

I'm doing a project with django and I have the following query in the admin of django I created the group "Volunteer", to which I gave permissions so you can manage dogs (create, modify, delete) Well now in the template, I have a button...
asked by 27.11.2018 / 18:41