diff --git a/backend/devpro/base/templates/base/base.html b/backend/devpro/base/templates/base/base.html new file mode 100644 index 0000000..213bcc9 --- /dev/null +++ b/backend/devpro/base/templates/base/base.html @@ -0,0 +1,10 @@ + + +
+ +Essa página pode ser alterada de acordo com a home do seu projeto
+Esse projeto já veio com login do Django configurado:
+ {% if request.user.is_authenticated %} + Alterar senha + + + {% else %} + Página de Login + {% endif %} + +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/templates/registration/login.html b/backend/devpro/base/templates/registration/login.html new file mode 100644 index 0000000..1e2f413 --- /dev/null +++ b/backend/devpro/base/templates/registration/login.html @@ -0,0 +1,11 @@ +{% extends 'base/base.html' %} +{% block title %}Página de Login{% endblock title %} +{% block body %} +{% translate 'Your password was changed.' %}
+ +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/templates/registration/password_change_form.html b/backend/devpro/base/templates/registration/password_change_form.html new file mode 100644 index 0000000..4616178 --- /dev/null +++ b/backend/devpro/base/templates/registration/password_change_form.html @@ -0,0 +1,55 @@ +{% extends 'base/base.html' %} +{% load i18n static %} +{% block title %}Página de Reset de senha{% endblock title %} +{% block body %} +{% translate "Your password has been set. You may go ahead and log in now." %}
+ + + +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/templates/registration/password_reset_confirm.html b/backend/devpro/base/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..7d06307 --- /dev/null +++ b/backend/devpro/base/templates/registration/password_reset_confirm.html @@ -0,0 +1,37 @@ +{% extends 'base/base.html' %} +{% load i18n static %} +{% block title %}Página de Reset de Senha{% endblock title %} +{% block body %} +{% translate "Please enter your new password twice so we can verify you typed it in correctly." %}
+ + + + {% else %} + +{% translate "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
+ + {% endif %} + +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/templates/registration/password_reset_done.html b/backend/devpro/base/templates/registration/password_reset_done.html new file mode 100644 index 0000000..c2909b4 --- /dev/null +++ b/backend/devpro/base/templates/registration/password_reset_done.html @@ -0,0 +1,11 @@ +{% extends 'base/base.html' %} +{% load i18n static %} +{% block title %}Página de Recuperação de senha{% endblock title %} +{% block body %} +{% translate 'We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}
+ +{% translate 'If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder.' %}
+ + +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/templates/registration/password_reset_form.html b/backend/devpro/base/templates/registration/password_reset_form.html new file mode 100644 index 0000000..55e2576 --- /dev/null +++ b/backend/devpro/base/templates/registration/password_reset_form.html @@ -0,0 +1,21 @@ +{% extends 'base/base.html' %} +{% load i18n static %} +{% block title %}Página de Recuperação de senha{% endblock title %} +{% block body %} +{% translate 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}
+ + + +{% endblock body %} \ No newline at end of file diff --git a/backend/devpro/base/tests/test_home.py b/backend/devpro/base/tests/test_home.py new file mode 100644 index 0000000..b4d5d48 --- /dev/null +++ b/backend/devpro/base/tests/test_home.py @@ -0,0 +1,3 @@ +def test_home_status(client): + resp = client.get('/') + assert resp.status_code == 200 diff --git a/backend/devpro/base/tests/test_login.py b/backend/devpro/base/tests/test_login.py new file mode 100644 index 0000000..ae165b9 --- /dev/null +++ b/backend/devpro/base/tests/test_login.py @@ -0,0 +1,6 @@ +from django.urls import reverse + + +def test_login_page_status(client): + resp = client.get(reverse('login')) + assert resp.status_code == 200 diff --git a/backend/devpro/base/urls.py b/backend/devpro/base/urls.py new file mode 100644 index 0000000..5580150 --- /dev/null +++ b/backend/devpro/base/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from devpro.base import views + +urlpatterns = [ + path('', views.home, name='home'), +] diff --git a/backend/devpro/base/views.py b/backend/devpro/base/views.py index fd0e044..eca7c99 100644 --- a/backend/devpro/base/views.py +++ b/backend/devpro/base/views.py @@ -1,3 +1,7 @@ -# from django.shortcuts import render +from django.shortcuts import render + # Create your views here. + +def home(request): + return render(request, 'base/home.html') diff --git a/backend/devpro/settings.py b/backend/devpro/settings.py index 1cc91a0..98dec2c 100644 --- a/backend/devpro/settings.py +++ b/backend/devpro/settings.py @@ -106,7 +106,9 @@ # Internationalization # https://docs.djangoproject.com/en/5.0/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL = '/' + +LANGUAGE_CODE = 'pt-br' TIME_ZONE = 'UTC' @@ -117,6 +119,9 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ +if DEBUG: + EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" + AWS_STORAGE_BUCKET_NAME = config('AWS_STORAGE_BUCKET_NAME', default='').strip() diff --git a/backend/devpro/urls.py b/backend/devpro/urls.py index d8d2c53..96eacfc 100644 --- a/backend/devpro/urls.py +++ b/backend/devpro/urls.py @@ -17,10 +17,12 @@ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), + path('', include('devpro.base.urls')), + path('accounts/', include('django.contrib.auth.urls')), ] if settings.AWS_STORAGE_BUCKET_NAME == '':