Questions tagged as 'django'

1
answer

How to mount a url in Django?

To learn Django, but one thing that I have not understood very well is how to set up a url, I know that it uses regular expression, but someone there has a way to explain it to me, p>     
asked by 28.01.2015 / 20:00
1
answer

Replace text BeautifulSoup

I have the following html: <p>Um acidente no cruzamento da rua ... </p> <div id="marca"></div> <p>Um acidente no cruzamento ......</p> <div id="marca2"></div> I'm trying to do this: def text...
asked by 30.08.2014 / 15:51
1
answer

How do I change the width of the columns in the Admin listing in Django?

How do I specify the width for the columns that are displayed in the Admin listing, more precisely the ones I specify in list_display in admin.py. Searching a similar question here , where I came to the conclusion that I should extend the file...
asked by 19.01.2016 / 15:54
1
answer

How do I organize my models in building a photo album in Django?

I'm building a photo album, but I do not know how to organize it. How should my models be? Class Foto(models.Model): foto = models.ImageField(upload_to='img') Class Album(models.Model): nome = models.CharField(max_length=100) foto...
asked by 05.05.2014 / 23:03
1
answer

Django - How does the @login_required decorator work in the views of another app?

I have a project in Django and only an application where I make registrations, searches, login to the system, etc. I was reading an article on the creation of projects and I saw that because of organization it is normal to have several applicati...
asked by 26.05.2014 / 18:22
1
answer

Django - How to handle Exception returned when trying to access a view protected by the @login_required decorator?

When the Exception occurs I want to make a redirect to an access denied template! The project at GitHub views.py # -*- coding: utf-8 -*- ## --------------------------- IMPORTS from django.shortcuts import render, render_to_respons...
asked by 20.05.2014 / 20:11
1
answer

How to use CreateView

I'm trying to create a simple task list, but I'm having some problems. I want to create a task, inside it I want to create some activities. This is the problem I can not do. How can I create an activity using a CreateView , however I wo...
asked by 23.05.2017 / 06:46
1
answer

Django - Getting form information

I have a template called listaarquivos.html where a table with information about an object of models.py called JOB appears. However, I now need to filter this table by date. I then inserted two inputs into listaarquivo...
asked by 24.10.2015 / 21:51
1
answer

Multiple Users and Authentication - Django

I'm developing a project in Django that has two types of users: Client and Accountant. Each one is authentic and has keys that identify them differently. The Client has as primary key his CNPJ. The accountant has as key the composition of his CR...
asked by 18.06.2018 / 02:49
1
answer

Single CPF but with blank = True

If I define cpf = models.CharField(max_length=11, unique=True, null=True, blank=True) It happens that if I leave a record with the null value, when I try to save a second record, it accuses the duplicate value. How to circumvent this sit...
asked by 30.07.2015 / 23:07