Skip to main content

Autenticação por email fourlabs para Django

Project description

🔐 Fourlabs Auth

Autenticação via e-mail corporativo para projetos Django, com código de verificação por e-mail, gerenciamento de conta, exportação de dados e mais.


🚀 Instalação

1. Instale via pip (local ou via PyPI)

pip install fourlabs-auth

⚙️ Configuração

1. Adicione fourlabs_auth no INSTALLED_APPS

# settings.py

INSTALLED_APPS = [
    ...
    'fourlabs_auth',
]

2. Configure o modelo de usuário customizado

AUTH_USER_MODEL = 'fourlabs_auth.User'

3. Middleware e context processors (mensagens)

MIDDLEWARE = [
    ...
    'django.contrib.messages.middleware.MessageMiddleware',
]

TEMPLATES = [
    {
        ...
        'OPTIONS': {
            'context_processors': [
                ...
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

4. Configure os templates e arquivos estáticos (se necessário)

STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / "static"]

TEMPLATES = [
    {
        ...
        'DIRS': [BASE_DIR / "templates"],
    }
]

🔗 URLs

Inclua as rotas da biblioteca no seu urls.py principal:

from django.urls import path, include

urlpatterns = [
    ...
    path('auth/', include('fourlabs_auth.urls')),
]

💾 Migrações

python manage.py makemigrations fourlabs_auth
python manage.py migrate

🧑‍💼 Funcionalidades Incluídas

Rota Descrição /auth/login/ Solicita o e-mail corporativo /auth/verify/ Verifica o código recebido /auth/edit-user-name/ Atualiza o nome do usuário /auth/change-password/ Altera a senha do usuário /auth/delete-account/ Encerra a conta do usuário /auth/export-user-data/ Exporta os dados em JSON /auth/logout/ Logout seguro do usuário

✏️ Customização

Você pode sobrescrever os templates HTML criando arquivos com o mesmo nome em:

templates/accounts/

📦 Exemplo de fluxo de autenticação

Acesse /auth/login/

Insira seu email da empresa (@foursys.com.br)

Verifique o código enviado e faça login

🧪 Requisitos

Django >= 3.2 Python >= 3.8

Gerar o Pacote

python setup.py sdist bdist_wheel

Publicar no PyPI

twine upload dist/*

Dicas para Atualizações

Aumente a versão em setup.py (version='0.1.1', por exemplo)

Apague a pasta dist/:

rm -rf dist/

Gere e envie novamente:

python setup.py sdist bdist_wheel
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fourlabs_auth-0.1.10.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fourlabs_auth-0.1.10-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file fourlabs_auth-0.1.10.tar.gz.

File metadata

  • Download URL: fourlabs_auth-0.1.10.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for fourlabs_auth-0.1.10.tar.gz
Algorithm Hash digest
SHA256 2dae7090a04eced059711350354dfc702ca23d982f90538f1e2d225e61c65ebb
MD5 da7c82351271ccc8f85438fdff8d583b
BLAKE2b-256 f9c4a1abc41b04179c9cb8bba6a38b850744072f14e5a29f50298642fb9f3252

See more details on using hashes here.

File details

Details for the file fourlabs_auth-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: fourlabs_auth-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for fourlabs_auth-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a625f6929b8e88bf330df0f459e9ff66385d03e50ce27f4f4971051a987278
MD5 831004e8d2b681f457aa850da0d339de
BLAKE2b-256 af07d4320076ab82669e251ab285d003d64cdd75f2ec2c243b896a80d417616a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page