Skip re-fetching a CPF from the per-pessoa Gennera loop when the bulk ingressantes step already resolved it for the same ano, cutting redundant HTTP fan-out. Add bounded retry with backoff on transient connection errors (never on HTTP status errors) across the four Gennera fetch functions, backed by a shared requests.Session for connection reuse instead of one-off urllib calls. Also stop syncing carga_horaria_integralizada from the API once a vinculo is FORMADO, matching the existing sticky-situacao rule, in both the vinculo import and the standalone carga-horaria command. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| config | ||
| core | ||
| docs | ||
| templates | ||
| .env.example | ||
| .gitignore | ||
| .python-version | ||
| docker-compose.yml | ||
| ESPECIFICACOES.md | ||
| ETAPAS.md | ||
| main.py | ||
| Makefile | ||
| manage.py | ||
| pyproject.toml | ||
| README.md | ||
| REGRAS_VINCULO.md | ||
| uv.lock | ||
Autocensup
Aplicacao Django configurada para usar PostgreSQL.
Requisitos
- Python 3.12+
- uv
- Docker e Docker Compose
Como rodar
Crie o arquivo de ambiente:
cp .env.example .env
Instale as dependencias:
UV_CACHE_DIR=/tmp/uv-cache uv sync
Suba o PostgreSQL:
docker compose up -d db
Execute as migracoes:
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py migrate
Carregue as UFs e municipios:
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py loaddata ufs municipios
Inicie o servidor:
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py runserver
A aplicacao ficara disponivel em http://127.0.0.1:8000/.
Comandos uteis
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py createsuperuser
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py test