Skip to main content

Django authentication app for Fourlabs Playground integration

Project description

FourLabs Playground Auth

A Django app para integração de autenticação com o Playground.
Este aplicativo fornece funcionalidades para autenticar usuários usando um token de acesso Playground e gerenciar organizações e projetos de forma eficiente.


🚀 Instalação

Clone e instale o pacote diretamente do repositório:

pip install git+https://fourlabs-un2@dev.azure.com/fourlabs-un2/Board%20Lab/_git/fourlabs-playground-auth

⚙ Configuração

1️⃣ Adicione no INSTALLED_APPS

No arquivo settings.py, inclua a aplicação:

INSTALLED_APPS = [
    ...
    'fourlabs_playground_auth',
]

Definir local para criar as migrações

MIGRATION_MODULES = {
    'fourlabs_playground_auth': 'custom_migrations.fourlabs_playground_auth',
}

Criar local para criar as migrações

mkdir -p custom_migrations/fourlabs_playground_auth
touch custom_migrations/fourlabs_playground_auth/__init__.py

2️⃣ Configure as Credenciais Playground

Defina as configurações necessárias para autenticação no Playground:

PLAYGROUND_URI = 'playground-uri'
SERVICE_ID = 'service-id'

3️⃣ Defina o Modelo de Usuário Padrão

Especifique o modelo de usuário personalizado para integração com o Playground:

AUTH_USER_MODEL = 'fourlabs_playground_auth.User'

🛠 Personalização de Campos do Projeto

O usuário pode definir dinamicamente os campos do modelo Project através do settings.py.

Exemplo:

PROJECT_CUSTOM_FIELDS = [
    {"name": "playstore_link", "type": "URLField", "verbose_name": "Link Play Store"},
    {"name": "appstore_link", "type": "URLField", "verbose_name": "Link App Store"},
    {"name": "twitter_link", "type": "URLField", "verbose_name": "Link Twitter"},
    {"name": "linkedin_link", "type": "URLField", "verbose_name": "Link LinkedIn"},
    {"name": "rating", "type": "FloatField", "verbose_name": "Avaliação"},
    {"name": "launch_date", "type": "DateField", "verbose_name": "Data de Lançamento"},
    {"name": "active", "type": "BooleanField", "verbose_name": "Está Ativo?", "params": {"default": True}},
    {"name": "support_email", "type": "EmailField", "verbose_name": "E-mail de Suporte"},
    {"name": "description", "type": "TextField", "verbose_name": "Descrição Completa"},
    {"name": "metadata", "type": "JSONField", "verbose_name": "Metadados Extras"},
]

Isso permitirá que o Django adicione esses campos automaticamente no modelo Project, sem necessidade de modificar o código-fonte.

🔄 Banco de Dados & Migrações

Após configurar o projeto, execute as migrações para refletir as alterações no banco de dados.

1️⃣ Criar as migrações

python manage.py makemigrations

2️⃣ Aplicar as migrações

python manage.py migrate

🌍 Uso

1️⃣ Adicione as URLs no urls.py

Para expor as rotas de autenticação, inclua no seu urls.py:

from django.urls import path, include

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

Isso garantirá que todas as funcionalidades de autenticação estejam acessíveis via /auth/.

📌 Recursos Principais

  • ✅ Autenticação via token Playground
  • ✅ Gerenciamento de usuários, organizações e projetos
  • ✅ Campos personalizados para o modelo Project via settings.py
  • ✅ Integração simples e flexível com qualquer projeto Django

📝 Licença

Este projeto está licenciado sob a MIT License.

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

playground_auth-0.2.8.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

playground_auth-0.2.8-py2.py3-none-any.whl (25.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file playground_auth-0.2.8.tar.gz.

File metadata

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

File hashes

Hashes for playground_auth-0.2.8.tar.gz
Algorithm Hash digest
SHA256 4b3c153ff827a46111573b254bdbe92394fd188e197758b5885aba8d495b7c59
MD5 7912afc64749be146d76c7577cba5403
BLAKE2b-256 ce57ff89978e7bd66e06ac8369fd1037c5559e747a260e0402cb160fcaa52a4b

See more details on using hashes here.

File details

Details for the file playground_auth-0.2.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for playground_auth-0.2.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58084f58a8e1c9fff67cf7b1a9af6a1ff8ec8158a712bd7452d16a917e727d54
MD5 370c9b15391aeb5d2a13b53d36ff5fbd
BLAKE2b-256 022e1acca1f565ba62e10fb86f0fe0c3c314efc090aeaf70cbec3498e336ead7

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