Questions tagged as 'django'

1
answer

'NoneType' object has no attribute 'split'

I can not access to search for a user since I get the error of split . This is my code: views.py def buscar_usuario(request): from django.utils import simplejson busqueda = request.GET.get('busqueda') busquedas = busqueda....
asked by 16.11.2018 / 22:55
2
answers

Validation of fields

My question may be very simple, but how can I validate that in a numeric field they can only add positive numbers and with a specific extension (length). Sorry for the inconvenience, thanks from django.db import models from django.utils import...
asked by 06.12.2018 / 16:52
1
answer

Problem with login django rest framework

I'm doing an api with django rest framework in which I use token authentication. My problem is that when I get the "username" and "password" parameters of a POST request, I can not identify my user (previously created) This is my code: models...
asked by 10.10.2018 / 17:15
1
answer

Adapting to a model dynamically django

I want to do the following declare a variable that contains the name of the model and travez of those variables execute the queries on that model example model="Person" model.objects.all ()     
asked by 19.04.2018 / 18:33
2
answers

Format Django numeric fields in template

I receive in my templates some numerical data from a view, for example a salary for this practical case 100,000: <td>{{ role.salary }}</td> But in the tenplate he shows it to me with x decimals:    100000,33333333 How can...
asked by 06.02.2018 / 20:54
2
answers

Something is wrong with variables typeManyToManyField

For my project I have created in my project a new model called displacement, which will be related to the animal model by means of a variable type manytomanyfield : class desplazamiento(models.Model): nombre=models.CharField(max_leng...
asked by 17.05.2017 / 23:59
1
answer

I'm using Psycopg2 but I get an error message could it be because I'm using Window10?

My code is as follows: import psycopg2 import pprint import sys def main(): #Variable conexion cadenaConexion="host=localhost dbname=test1 user=postgres password=admin" print("Cadena conexion a la BD\n ->%s"%(cadenaConexi...
asked by 13.04.2017 / 16:16
3
answers

Error with Column Name in Django

I have a problem with a database in SqlServer 2008, I'm doing some reports to show them in a Django project from a production database, which is used by another system, I have the following view: class DetalleDeuda(ListView): model = T090D...
asked by 27.07.2016 / 02:20
2
answers

Non-mandatory fields using Django Form

Good afternoon I am creating a form to create clients in Django 1.10 using forms that the framework brings. This form brings some fields that are NOT obligatory but at the time of saving it asks me to complete them. How can I solve this? I le...
asked by 28.10.2016 / 23:56
2
answers

Context processor for templates | ValueError - Django

Very good friends, I have my custom context processor, so that it can be used in all the django project templates in the form of a variable: {{ u_model }} This is my context processor: proccesors.py from django.contrib.auth.decorator...
asked by 17.09.2018 / 22:11