mirror of https://github.com/interlegis/sapl.git
Marcio Mazza
5 years ago
233 changed files with 4215 additions and 2399 deletions
@ -0,0 +1,8 @@ |
|||
FROM python:3.7 |
|||
ENV PYTHONUNBUFFERED 1 |
|||
WORKDIR /sapl-dev |
|||
COPY requirements ./requirements/ |
|||
RUN apt update && \ |
|||
apt -y install graphviz-dev && \ |
|||
pip install -r ./requirements/dev-requirements.txt |
|||
EXPOSE 8000 |
@ -0,0 +1,40 @@ |
|||
version: '3.7' |
|||
|
|||
services: |
|||
sapldb-dev: |
|||
container_name: sapldb-dev |
|||
image: postgres:10.5-alpine |
|||
environment: |
|||
POSTGRES_PASSWORD: sapl |
|||
POSTGRES_USER: sapl |
|||
POSTGRES_DB: sapl |
|||
ports: |
|||
- "5433:5432" |
|||
networks: |
|||
- sapl-net-dev |
|||
|
|||
sapl-dev: |
|||
container_name: sapl-dev |
|||
image: sapl:dev |
|||
build: |
|||
context: . |
|||
dockerfile: Dockerfile.dev |
|||
command: python3 manage.py runserver 0:8000 |
|||
volumes: |
|||
- .:/sapl-dev |
|||
ports: |
|||
- "8000:8000" |
|||
environment: |
|||
SECRET_KEY: '$dkhxm-$zvxdox$g2-&w^1i!_z1juq0xwox6e3#gy6w_88!3t^' |
|||
DEBUG: 'True' |
|||
DATABASE_URL: postgresql://sapl:sapl@sapldb-dev:5432/sapl |
|||
TZ: America/Sao_Paulo |
|||
depends_on: |
|||
- sapldb-dev |
|||
networks: |
|||
- sapl-net-dev |
|||
|
|||
networks: |
|||
sapl-net-dev: |
|||
name: sapl-net-dev |
|||
driver: bridge |
@ -1,34 +1,65 @@ |
|||
sapldb: |
|||
image: postgres:10.5-alpine |
|||
restart: always |
|||
environment: |
|||
POSTGRES_PASSWORD: sapl |
|||
POSTGRES_USER: sapl |
|||
POSTGRES_DB: sapl |
|||
PGDATA : /var/lib/postgresql/data/ |
|||
volumes: |
|||
- sapldb_data:/var/lib/postgresql/data/ |
|||
ports: |
|||
- "5433:5432" |
|||
sapl: |
|||
image: interlegis/sapl:3.1.160-RC12 |
|||
#build: . |
|||
restart: always |
|||
environment: |
|||
ADMIN_PASSWORD: interlegis |
|||
ADMIN_EMAIL: email@dominio.net |
|||
DEBUG: 'False' |
|||
EMAIL_PORT: 587 |
|||
EMAIL_USE_TLS: 'False' |
|||
EMAIL_HOST: smtp.dominio.net |
|||
EMAIL_HOST_USER: usuariosmtp |
|||
EMAIL_SEND_USER: usuariosmtp |
|||
EMAIL_HOST_PASSWORD: senhasmtp |
|||
TZ: America/Sao_Paulo |
|||
volumes: |
|||
- sapl_data:/var/interlegis/sapl/data |
|||
- sapl_media:/var/interlegis/sapl/media |
|||
links: |
|||
- sapldb |
|||
ports: |
|||
- "80:80" |
|||
version: "3.7" |
|||
services: |
|||
sapldb: |
|||
image: postgres:10.5-alpine |
|||
restart: always |
|||
environment: |
|||
POSTGRES_PASSWORD: sapl |
|||
POSTGRES_USER: sapl |
|||
POSTGRES_DB: sapl |
|||
PGDATA : /var/lib/postgresql/data/ |
|||
volumes: |
|||
- sapldb_data:/var/lib/postgresql/data/ |
|||
ports: |
|||
- "5433:5432" |
|||
networks: |
|||
- sapl-net |
|||
saplsolr: |
|||
image: solr:8.3 |
|||
restart: always |
|||
command: bin/solr start -c -f |
|||
volumes: |
|||
- solr_data:/opt/solr/server/solr |
|||
- solr_configsets:/opt/solr/server/solr/configsets |
|||
ports: |
|||
- "8983:8983" |
|||
networks: |
|||
- sapl-net |
|||
sapl: |
|||
image: interlegis/sapl:3.1.161-RC3 |
|||
#build: . |
|||
restart: always |
|||
environment: |
|||
ADMIN_PASSWORD: interlegis |
|||
ADMIN_EMAIL: email@dominio.net |
|||
DEBUG: 'False' |
|||
EMAIL_PORT: 587 |
|||
EMAIL_USE_TLS: 'False' |
|||
EMAIL_HOST: smtp.dominio.net |
|||
EMAIL_HOST_USER: usuariosmtp |
|||
EMAIL_SEND_USER: usuariosmtp |
|||
EMAIL_HOST_PASSWORD: senhasmtp |
|||
USE_SOLR: 'True' |
|||
SOLR_COLLECTION: sapl |
|||
SOLR_URL: http://saplsolr:8983 |
|||
TZ: America/Sao_Paulo |
|||
volumes: |
|||
- sapl_data:/var/interlegis/sapl/data |
|||
- sapl_media:/var/interlegis/sapl/media |
|||
depends_on: |
|||
- sapldb |
|||
- saplsolr |
|||
ports: |
|||
- "80:80" |
|||
networks: |
|||
- sapl-net |
|||
networks: |
|||
sapl-net: |
|||
name: sapl-net |
|||
driver: bridge |
|||
volumes: |
|||
sapldb_data: |
|||
sapl_data: |
|||
sapl_media: |
|||
solr_data: |
|||
solr_configsets: |
|||
|
@ -0,0 +1,17 @@ |
|||
1. Realizar o migrate |
|||
|
|||
./manage.py migrate |
|||
|
|||
2. Criar um API Token para usuário e anotar a API Key gerada. |
|||
|
|||
python3 manage.py drf_create_token admin |
|||
|
|||
3. Testar endpoint |
|||
curl http://localhost:8000/api/version -H 'Authorization: Token <API Key>' |
|||
|
|||
4. Exemplo de POST |
|||
curl -d '{"nome_completo”:”Gozer The Gozerian“, "nome_parlamentar": “Gozer”, "sexo":"M"}' -X POST http://localhost:8000/api/parlamentares/parlamentar/ -H 'Authorization: Token <API Key>' -H 'Content-Type: application/json' |
|||
|
|||
Note: If you use TokenAuthentication in production you must ensure that your API is only available over https. |
|||
|
|||
References: https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication |
@ -0,0 +1,27 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-27 17:40 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
from django.conf import settings |
|||
from django.contrib.auth import get_user_model |
|||
from rest_framework.authtoken.models import Token |
|||
|
|||
|
|||
def adiciona_token_de_usuarios(apps, schema_editor): |
|||
for user in get_user_model().objects.all(): |
|||
Token.objects.get_or_create(user=user) |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
initial = True |
|||
|
|||
dependencies = [ |
|||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
|||
('authtoken', '0002_auto_20160226_1747') |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(adiciona_token_de_usuarios) |
|||
] |
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-05-18 14:58 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0031_auto_20200407_1406'), |
|||
('materia', '0067_auto_20200416_1538'), |
|||
('audiencia', '0014_auto_20191023_1538'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='audienciapublica', |
|||
name='parlamentar_autor', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar Autor'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='audienciapublica', |
|||
name='requerimento', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='requerimento', to='materia.MateriaLegislativa', verbose_name='Requerimento da Audiência Pública'), |
|||
), |
|||
] |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-06-02 12:15 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('comissoes', '0023_auto_20191211_1752'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='composicao', |
|||
name='comissao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='participacao', |
|||
name='composicao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participacao_set', to='comissoes.Composicao', verbose_name='Composição'), |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-06-05 13:51 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('comissoes', '0024_auto_20200602_0915'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='reuniao', |
|||
name='comissao', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'), |
|||
), |
|||
] |
@ -1,3 +1,12 @@ |
|||
from django.contrib import admin |
|||
from sapl.compilacao.models import TipoDispositivo |
|||
from sapl.utils import register_all_models_in_admin |
|||
|
|||
register_all_models_in_admin(__name__) |
|||
admin.site.unregister(TipoDispositivo) |
|||
|
|||
|
|||
@admin.register(TipoDispositivo) |
|||
class TipoDispositivoAdmin(admin.ModelAdmin): |
|||
readonly_fields = ("rotulo_prefixo_texto", "rotulo_sufixo_texto",) |
|||
list_display = [f.name for f in TipoDispositivo._meta.fields if f.name != 'id'] |
|||
|
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.27 on 2020-03-13 14:37 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0064_auto_20200114_1121'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='assuntomateria', |
|||
options={'ordering': ('assunto', 'dispositivo'), 'verbose_name': 'Assunto de Matéria', 'verbose_name_plural': 'Assuntos de Matéria'}, |
|||
), |
|||
migrations.AlterModelOptions( |
|||
name='materiaassunto', |
|||
options={'ordering': ('assunto__assunto', '-materia'), 'verbose_name': 'Relação Matéria - Assunto', 'verbose_name_plural': 'Relações Matéria - Assunto'}, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-03-13 17:41 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0065_auto_20200313_1137'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='descricao', |
|||
field=models.TextField(verbose_name='Ementa'), |
|||
), |
|||
] |
@ -0,0 +1,30 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-16 18:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0066_auto_20200313_1441'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='tramitacao', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2020-02-21 18:33 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0031_auto_20200114_1121'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='veiculo_publicacao', |
|||
field=models.CharField(blank=True, max_length=200, verbose_name='Veículo de Publicação'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-16 18:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0032_auto_20200221_1533'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-07 17:06 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0030_auto_20190613_1133'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='partido', |
|||
name='sigla', |
|||
field=models.CharField(max_length=20, verbose_name='Sigla'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.26 on 2020-01-15 14:41 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0030_auto_20200114_1121'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='documentoadministrativo', |
|||
name='complemento', |
|||
field=models.CharField(blank=True, max_length=10, verbose_name='Complemento'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-16 18:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0031_documentoadministrativo_caractere_identificador'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='documentoadministrativo', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='tramitacaoadministrativo', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
] |
@ -0,0 +1,30 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.29 on 2020-04-16 18:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('sessao', '0050_auto_20191029_1441'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='registroleitura', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='registrovotacao', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='votoparlamentar', |
|||
name='ip', |
|||
field=models.CharField(blank=True, default='', max_length=60, verbose_name='IP'), |
|||
), |
|||
] |
@ -0,0 +1,15 @@ |
|||
.ancora{ |
|||
padding: 10px; |
|||
border: 1px solid #a2a9b1; |
|||
background-color: #f8f9fa; |
|||
width: 180px; |
|||
height: 130px; |
|||
margin-left: 15px; |
|||
font-size: 95%; |
|||
} |
|||
|
|||
.titulo-conteudo{ |
|||
text-align: center; |
|||
font-weight: bold; |
|||
padding-bottom: 15px; |
|||
} |
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue