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)

Local (modo desenvolvimento):

pip install -e /caminho/para/fourlabs_auth/

Ou (se publicado no PyPI):

pip install foursys-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.7.tar.gz (7.3 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.7-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fourlabs_auth-0.1.7.tar.gz
  • Upload date:
  • Size: 7.3 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.7.tar.gz
Algorithm Hash digest
SHA256 8c473fd00feaee6e57f72095bf95b6f478c874f552f35ad088de740380ce78ff
MD5 0a47dab78c8c87275731b8f4e69d7cb2
BLAKE2b-256 1f09559c33db67b53a40dc6556e85118ac8c3fdb7483457403b045ae51a8af3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fourlabs_auth-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4c555e52dd71659b77ac10dfb19008145e3389c328044522f79f10960169784e
MD5 653f31068bafe95f603105fa0810cd9d
BLAKE2b-256 f037701fae847798b24d72532e0a96baa3917a295e7c6e5baed75131fe8a503f

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