Skip to content

Commit

Permalink
Correções executdas para home e login
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigmars committed Apr 11, 2024
1 parent 13a8dc8 commit 56517a9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
7 changes: 7 additions & 0 deletions main/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block title %}
Home
{% endblock title %}
{% block content %}
<h1>Pagina Home</h1>
{% endblock content %}
7 changes: 6 additions & 1 deletion main/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from django.shortcuts import render
from django.shortcuts import render, redirect

# @login_required(login_url='/auth/login')


def home(request):

# return redirect('login')

return render(request, "base.html", {})
37 changes: 16 additions & 21 deletions usuarios/templates/login.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
{% extends "base.html" %}
{% block title %}
Login
{% endblock title %}
{% block content %}
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>

<body>
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<label>
<input type="checkbox" checked="checked" name="remember">
Remember me
</label>
<div>
<label for="">Email</label>
<input type="text"
name="email"
id="email"
placeholder="[email protected]"
required="required"
pattern="^[0-9a-zA-Z-._+]+@[a-zA-Z0-9-_+]+\.[a-zA-Z]+(\.[a-zA-Z]+)?">
<input type="text" name="email" id="email" placeholder="[email protected]" required="required"
pattern="^[0-9a-zA-Z-._+]+@[a-zA-Z0-9-_+]+\.[a-zA-Z]+(\.[a-zA-Z]+)?">
<span>(*)</span>
</div>
<div>
<label for="">Senha</label>
<input type="password"
name="senha"
id="senha"
placeholder="Senha"
required="required">
<input type="password" name="senha" id="senha" placeholder="Senha" required="required">
<span>(*)</span>
</div>
<button type="submit">Login</button>
Expand All @@ -38,4 +31,6 @@
<span>Forgot <a href="#">password?</a></span>
</div>
</form>
{% endblock content %}
</body>

</html>
1 change: 0 additions & 1 deletion usuarios/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


def login(request):
print("chegando aqui login")
return render(request, 'login.html')

# @login_required(login_url='/auth/login')
Expand Down

0 comments on commit 56517a9

Please sign in to comment.