57 lines
863 B
Markdown
57 lines
863 B
Markdown
## Autocensup
|
|
|
|
Aplicacao Django configurada para usar PostgreSQL.
|
|
|
|
### Requisitos
|
|
|
|
- Python 3.12+
|
|
- uv
|
|
- Docker e Docker Compose
|
|
|
|
### Como rodar
|
|
|
|
Crie o arquivo de ambiente:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
Instale as dependencias:
|
|
|
|
```bash
|
|
UV_CACHE_DIR=/tmp/uv-cache uv sync
|
|
```
|
|
|
|
Suba o PostgreSQL:
|
|
|
|
```bash
|
|
docker compose up -d db
|
|
```
|
|
|
|
Execute as migracoes:
|
|
|
|
```bash
|
|
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py migrate
|
|
```
|
|
|
|
Carregue as UFs e municipios:
|
|
|
|
```bash
|
|
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py loaddata ufs municipios
|
|
```
|
|
|
|
Inicie o servidor:
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py createsuperuser
|
|
UV_CACHE_DIR=/tmp/uv-cache uv run python manage.py test
|
|
```
|