Skip to main content

🔐 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/*

Metadata

Release files for fourlabs-auth 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fourlabs-auth 0.1.18
File Size Uploaded
fourlabs_auth-0.1.18.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fourlabs-auth 0.1.18
File Interpreter ABI Platform
fourlabs_auth-0.1.18-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / fourlabs_auth-0.1.18.tar.gz

Download URL fourlabs_auth-0.1.18.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
95f408fb80fc7274a6ca17f20211569be23554175257d172bdf806e37da88357
BLAKE2b-256 checksum
How to use checksums
79bf82be5874ae8ef7be345fd42bdfb52fadc172649b917ccd0ad1bdc6e3b6cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / fourlabs_auth-0.1.18-py3-none-any.whl

Download URL fourlabs_auth-0.1.18-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
235b582f0394a0a4218f0401491bc7e15d08c60302438784064e7e2c8853974e
BLAKE2b-256 checksum
How to use checksums
c491851eb7b64591e885282a80ac513493ac4dac2893a63e6747bf10ab28fd67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.18 This release

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page