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 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.9.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.9-py2.py3-none-any.whl (25.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: playground_auth-0.2.9.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.9.tar.gz
Algorithm Hash digest
SHA256 35763128b8573ff2fa6f2bd6a7a1067181d80768c5abbff57534e490dc0513b6
MD5 af8420c7feee938b8a3bef9fedc78bc3
BLAKE2b-256 b1c5c23b7d5930d7e2be6a95379bd1dceb001951e717ecfa6c8604907928d7ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for playground_auth-0.2.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b5c801a5c5d26e1f49ea3f0c2fffb7b181aa917b06a4d12a5b2b236f2754d6a1
MD5 f07f8e06e2d53747288faade3fbfc70e
BLAKE2b-256 a540fd2d070cb2a96cd066ec24fbb2d827cb61af226a3b7b13e9bc3a0c9f3c5c

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