Questions tagged as 'django'

1
answer

Deploy in Heroku application PYTHON / DJANGO giving error

I made a change in the default auth of django and my project is working correctly however when I give git push heroku master and then I use the command heroku run python manage.py migrate to create my database and it gives the error:    djang...
asked by 11.06.2017 / 20:32
1
answer

Hide CRUD buttons in Django templates for users who are not logged into the system

I would like to hide the buttons on my system that allow you to: add, edit and delete the data in my templates for users who are not logged into the system. It can be viewed here: link After some queries, I saw that it can be done this way:...
asked by 25.04.2016 / 14:22
2
answers

Error in Django Module

Whenever I try to run, I'm getting the following error described below. I've already researched a solution, but I can not get it to work.    Exception Type: ValueError       Exception Value:       ModelForm has no model class specified.     ...
asked by 16.05.2016 / 15:31
0
answers

How to create a custom model field inheriting ForeignKey in Django?

I want to build a custom field model that behaves like ForeignKey, but with some additional details. This custom field will automatically register a document, passing the model name as a reference. Therefore, if I am registering a person, a d...
asked by 25.11.2015 / 19:18
1
answer

What can happen to my project if I remove the virtual environment configured for it?

Let's say I created a virtual environment through virtualenvwrapper $ mkvirtualenv venv . I create my project, make the necessary settings, start working on the project and one day I remove the virtual environment $ rmvirtualenv venv...
asked by 19.09.2015 / 17:53
1
answer

How to count people by age

I have class Person(TimeStampedModel, Address): name = models.CharField(_('nome'), max_length=100) birthday = models.DateField(_('data de nascimento')) and the function import datetime from datetime import date ''' http://keyes.i...
asked by 08.06.2015 / 08:53
0
answers

Catching a JSON using JavaScript [closed]

Django creates a file named views.py , in which I have the following function: def carro_view(request,carro_slug=None): evento = Evento.objects.filter(time = '11:28:30').distinct() data = [] for x in evento: data.append({...
asked by 09.02.2015 / 17:19
1
answer

Using json to copy data (Django)

I thought better, and I think I'll use json. def entry_detail_json(request, pk): data = Entry.objects.filter(pk=pk) s = serializers.serialize("json", data) return HttpResponse(s) But being on the page http://localhost:8000/ent...
asked by 30.07.2015 / 22:29
1
answer

django validate cpf and treat error

I'm using the BRCPFField of the localflavors package to validate the CPF in a form, it's working, the problem is that in the template when I type an invalid CPF that django error page appears, I just wanted a message to be displayed and the pers...
asked by 19.06.2015 / 16:55
1
answer

Leaving all highlighted column (Django + template)

I'm trying to make the entire column colorful, but only the last line is getting. I've tried all the possible logic, but I'm not getting it right. This post is a continuation of Total and subtotal in django template using lists . views...
asked by 24.12.2015 / 07:37