Questions tagged as 'django'

1
answer

Django login view only works with users created in createsuperuser

I've been busting my head with this problem for a few days. I am doing a project for college and created a custom user, I can add users normally in my template, they are committed in the bd, but in the login template, they do not log in. I can o...
asked by 27.05.2018 / 01:46
2
answers

Django - No User matches the given query

Good afternoon, I'm new to Django and I have the following error: I can not access the admin. I have checked the url several times and everything is correct. Until a day ago I was accessing the admin normally.     
asked by 21.05.2018 / 20:51
1
answer

Photo upload with Model name in Django

I would like help with a task saving images with a custom name and a folder also with the current name, suppose the following Model: class ProdutoA(models.Model): nome_produto_a = models.CharField(max_length=50, verbose_name='Nome do Produ...
asked by 11.05.2018 / 18:04
1
answer

Passing several attributes in django

My question is the following. I am starting my studies in django and encounter a problem. I have a function in my view with the following excerpt def saldo_total(request): receitas = Receitas.objects.aggregate(Sum('valor')) total_recei...
asked by 05.05.2018 / 22:58
0
answers

Receiving Post Json in Django FrameWork

If I send a post like this: data={ 'supplier': supplier_name, 'date': date, 'payment':payment, 'material':[{"name":"tubo","qtd":3,"price":3},{"name":"calha","qtd":4,"price":5}] } $.ajax({ type:"POST", url:"{%...
asked by 09.05.2018 / 21:30
1
answer

Error with the django-blog-zinnia users model

I created a project from scratch with cookiecutter-django , using version 1.9.9, since in documentation of the django-blog-zinnia package it is recommended to use django < 2.0. To use version 1.9.9 I simply downloaded cookiecutter-django o...
asked by 01.05.2018 / 11:38
1
answer

Django - select options

I'm trying to put the names of the coordinators in the options of a select looking for the database, I've already researched and it seems that there is another way to use the select in django, but it was not very clear, so I'm posting here my co...
asked by 08.05.2018 / 00:45
1
answer

How do I insert data into a foreign key table in django?

class Address (models.Model): cep = models.IntegerField('cep', max_length=10) rua = models.CharField('rua', max_length=100) numero = models.CharField('numero', max_length=10) bairro = models.CharField('bairro', max_length=50) estado = models.C...
asked by 08.05.2018 / 22:42
0
answers

Execute javascript code on page only when redirected - DJANGO

Good afternoon guys, how are you? There goes my first question! I've been learning Django for less than a month, I'm doing a practical project, this project is a login screen. It already works perfectly, user puts the right password, it goes...
asked by 08.05.2018 / 22:15
1
answer

Django FileField Restriction in Image and Video

I would like to know how I can limit the file type in FileField of Django? I know I can add this validation to the Form. I just wish they could send videos and images in this field, nothing more.     
asked by 26.04.2018 / 23:09