Questions tagged as 'django'

2
answers

FieldError: Relation fields do not support nested lookups

I'm trying to do a query in Django with several joins , and I came across this error that I do not know what it means: Tag.objects.filter(dset__descendant__entities__entity=e)    FieldError: Relation fields do not support nested lookups...
asked by 22.01.2016 / 19:10
3
answers

How to ensure that a service is always running on CentOS?

I created a startup script for my application in CentOS, so I can use the following commands to initialize / stop the application: service django_app start service django_app stop How do I make sure this service is always running? For ex...
asked by 12.02.2014 / 18:09
3
answers

How do I prevent Django from finding IDs in the template?

I'm using Django 1.4 with location (L10N) enabled, which causes numeric values in the template to be formatted: 1.234,56 . The problem is that every time I put ID in the template, for example: data-id="{{ form.instance.id }...
asked by 11.12.2013 / 17:21
1
answer

What are the differences between Flask and Django?

I started shortly in the Python language and am currently working on a project using Flask , MariaDB and WebSockets . I see people talk a lot about Django and would like to know the differences between two.     
asked by 23.08.2017 / 09:45
3
answers

How do I return a value in the Brazilian currency format in the Django view?

How do I return the 1768 value in the currency format BRL 1.768,00 in the Django view? def moeda(request): valor = 1768 # formata o valor return HttpResponse('Valor: %s' % valor)     
asked by 27.05.2015 / 15:32
2
answers

Django and Template

Good Night! Guys, I have a problem for 4 days and unfortunately I still can not solve it! I'm working with tamplates in DJango, but I'm having problems because nothing appears on the pages! This is the basic structure of the base.html &...
asked by 28.07.2015 / 02:12
2
answers

Check file extension in template - Django

I have a Django application where in the template I need to validate the extension of a file coming from filefield. <div class="row"> <p class="anexos"> {% trans 'Anexos' %} </p> #if .jpg .png <div class="col-s...
asked by 04.08.2015 / 20:42
1
answer

What are the best practices for working with Legacy Database in Django?

I have a legacy database and would like to know what good practices for naming tables, or tips on how to use inflections (as in Rails) for Django in the latest version.     
asked by 21.01.2014 / 18:34
2
answers

How to serve files with access control in Django?

When studying Django, the typical way to handle file upload was to create a media folder on the server - setting MEDIA_ROOT and MEDIA_URL to settings.py - where every uploaded file would go. In models, a FileField...
asked by 21.05.2015 / 21:55
1
answer

Django 'bool' object has no attribute '_committed'

I have a field of type FileField and when I try to delete the contents of it, it returns me this error message: ´bool' object has no attribute '_committed' To upload normally, the problem is only when I try to remove the uploade...
asked by 11.02.2014 / 17:35