GithubHelp home page GithubHelp logo

lscosta90br / django-auth-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rg3915/django-auth-tutorial

0.0 1.0 0.0 1.01 MB

Meu tutorial de Autenticação com Django em pt-br

Python 4.49% CSS 90.16% HTML 5.35%

django-auth-tutorial's Introduction

Guia de autenticação com Django

Este projeto foi feito com:

Como rodar o projeto?

  • Clone esse repositório.
  • Crie um virtualenv com Python 3.
  • Ative o virtualenv.
  • Instale as dependências.
  • Rode as migrações.
git clone https://github.com/rg3915/django-auth-tutorial.git
cd django-auth-tutorial
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python contrib/env_gen.py
python manage.py migrate
python manage.py createsuperuser --username='admin' --email=''

Configurar settings.py

INSTALLED_APPS = [
    'myproject.accounts',  # <---
    'django.contrib.admin',
    'django.contrib.auth',
    ...
    'django_extensions',
    'widget_tweaks',
    'myproject.core',
]

LOGIN_URL = 'login'
LOGIN_REDIRECT_URL = 'core:index'
LOGOUT_REDIRECT_URL = 'core:index'

Leia o passo-a-passo.md.

Telas

Login

01_login.png

Cadastro

02_signup.png

Trocar senha

03_change_password.png

Esqueci minha senha

04_forgot_password.png

Estrutura

Login

101_login_logout.png

Cadastro

102_signup.png

Trocar senha

103_change_password.png

Esqueci minha senha

104_reset_password.png

MailHog

Rodar MailHog via Docker.

docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog

Configurar settings.py

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', 'webmaster@localhost')
EMAIL_HOST = config('EMAIL_HOST', '0.0.0.0')  # localhost
EMAIL_PORT = config('EMAIL_PORT', 1025, cast=int)
EMAIL_HOST_USER = config('EMAIL_HOST_USER', '')
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', '')
EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=False, cast=bool)

Links

https://docs.djangoproject.com/en/3.1/topics/auth/default/#module-django.contrib.auth.views

https://simpleisbetterthancomplex.com/tutorial/2016/09/19/how-to-create-password-reset-view.html

https://simpleisbetterthancomplex.com/tutorial/2017/02/18/how-to-create-user-sign-up-view.html

https://simpleisbetterthancomplex.com/tips/2016/08/04/django-tip-9-password-change-form.html

https://github.com/egorsmkv/simple-django-login-and-register

https://github.com/Antonio-Neves/Custom-User-Django-pt

https://github.com/django/django/tree/main/django/contrib/admin/templates/registration

https://github.com/django/django/blob/main/django/contrib/auth/views.py

https://github.com/django/django/blob/main/django/contrib/auth/forms.py

https://github.com/django/django/blob/main/django/contrib/auth/tokens.py

django-auth-tutorial's People

Contributors

rg3915 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.