-1
my Register.html is like this
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<title>Sistema de cadastramento de Bens</title>
</head>
<body>
<div class ='col-8 m-auto pt-2 pb-2 text-center'>
<h1>Cidadãos cadastradoos</h1>
</div>
<div class="row">
<div class ='col-8 m-auto pt-2 pb-2 text-center'>
<a href="/accounts/login/" class="btn btn-info">Voltar</a>
</div>
<div class="col-8 m-auto pt-3 pb-2 text-center">
<div class="card auth-card">
<div class="card.body">
<h4 class="card-title text-center">Entrar no Sistema de Bens</h4>
<form method="post">
{% csrf_token %}
<div class="form-group">
{{form.username.errors}}
<label>Username: </label><br>
{{form.username}}
</div>
<div class="form-group">
{{form.password1.errors}}
<label>Senha: </label><br>
{{form.password1}}
</div>
<div class="form-group">
{{form.password2.errors}}
<label>Confirmação de senha: </label><br>
{{form.password2}}
</div>
<div class="form-group">
<input type="submit" value="Cadastrar" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
I tried to put the email in this pattern but it was not. Someone could help me??
my models.py
from django.db import models
from django.contrib.auth.models import User
class Cidadao(models.Model):
nomebens = models.CharField(max_length=100)
nomecompleto = models.CharField(max_length=150)
numSerie = models.CharField(max_length=100)
endereco = models.CharField(max_length=250)
email = models.EmailField()
observacao = models.TextField()
user = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return self.user
show how this model class, with it can rewrite that part reuse Django authentication.
– stack.cardoso
put on topic la,
– thiago costa
you will be using the admin panel of Django to add a new user , having only a super administrator controlling it?
– stack.cardoso
this mail in case wanted to get, because it is not related to the User class..
– thiago costa
i wanted the user to register themselves so I didn’t use admin
– thiago costa
Minutes, and will not have permission of groups?
– stack.cardoso
no, you won’t have no
– thiago costa
This great then, I will try to recreate this problem and explain the code
– stack.cardoso