{"id":22542383,"url":"https://github.com/pjecz/pjecz-plataforma-web","last_synced_at":"2025-04-09T22:43:28.176Z","repository":{"id":37849667,"uuid":"327799099","full_name":"PJECZ/pjecz-plataforma-web","owner":"PJECZ","description":"Sistema web para administrar la publicación de Edictos, Listas de Acuerdos, V.P. de Sentencias y más.","archived":false,"fork":false,"pushed_at":"2024-09-27T18:35:12.000Z","size":11012,"stargazers_count":2,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T22:36:35.832Z","etag":null,"topics":["flask","hacktoberfest","hacktoberfest-accepted","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PJECZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-08T04:33:43.000Z","updated_at":"2024-09-27T18:34:58.000Z","dependencies_parsed_at":"2024-04-09T21:31:58.645Z","dependency_job_id":"5356b2bc-bf61-449f-b033-376afdb0ef3b","html_url":"https://github.com/PJECZ/pjecz-plataforma-web","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJECZ%2Fpjecz-plataforma-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJECZ%2Fpjecz-plataforma-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJECZ%2Fpjecz-plataforma-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJECZ%2Fpjecz-plataforma-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PJECZ","download_url":"https://codeload.github.com/PJECZ/pjecz-plataforma-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125184,"owners_count":21051761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","hacktoberfest","hacktoberfest-accepted","python"],"created_at":"2024-12-07T13:10:11.050Z","updated_at":"2025-04-09T22:43:28.155Z","avatar_url":"https://github.com/PJECZ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pjecz-plataforma-web\n\nAdministrador de contenidos del sitio web del PJECZ.\n\n## Entorno Virtual con Python 3.8\n\nCrear el entorno virtual dentro de la copia local del repositorio, con\n\n    python3.8 -m venv venv\n\nActive el entorno virtual, en Linux con...\n\n    source venv/bin/activate\n\nO en windows con\n\n    venv/Scripts/activate\n\nVerifique que haya el mínimo de paquetes con\n\n    pip list\n\nActualice el pip de ser necesario\n\n    pip install --upgrade pip\n\nY luego instale los paquetes que requiere Plataforma Web\n\n    pip install -r requirements.txt\n\nVerifique con\n\n    pip list\n\nInstalar el Comando Cli\n\n    pip install --editable .\n\n## Configurar\n\nDebe crear un archivo `instance/settings.py` que defina su conexion a la base de datos...\n\n    \"\"\"\n    Configuracion para desarrollo\n    \"\"\"\n    import os\n\n\n    # Base de datos\n    DB_USER = os.environ.get(\"DB_USER\", \"wronguser\")\n    DB_PASS = os.environ.get(\"DB_PASS\", \"badpassword\")\n    DB_NAME = os.environ.get(\"DB_NAME\", \"pjecz_plataforma_web\")\n    DB_HOST = os.environ.get(\"DB_HOST\", \"127.0.0.1\")\n    DB_PORT = os.environ.get(\"DB_PORT\", \"5432\")\n\n    # PostgreSQL\n    SQLALCHEMY_DATABASE_URI = f\"postgresql+psycopg2://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}\"\n\nGuarde sus configuraciones, contrasenas y tokens en un archivo `.env`\n\n    # Flask, para SECRET_KEY use openssl rand -hex 24\n    FLASK_APP=plataforma_web.app\n    FLASK_DEBUG=1\n    SECRET_KEY=XXXXXXXXXXXXXXXX\n\n    # Base de datos\n    DB_HOST=127.0.0.1\n    DB_PORT=8432\n    DB_NAME=pjecz_plataforma_web\n    DB_USER=adminpjeczplataformaweb\n    DB_PASS=XXXXXXXXXXXXXXXX\n\n    # Redis\n    REDIS_URL=redis://127.0.0.1\n    TASK_QUEUE=pjecz_plataforma_web\n\n    # Google Cloud Storage\n    CLOUD_STORAGE_DEPOSITO=\n    CLOUD_STORAGE_DEPOSITO_EDICTOS=\n    CLOUD_STORAGE_DEPOSITO_GLOSAS=\n    CLOUD_STORAGE_DEPOSITO_LISTAS_DE_ACUERDOS=\n    CLOUD_STORAGE_DEPOSITO_SENTENCIAS=\n    CLOUD_STORAGE_DEPOSITO_USUARIOS=\n\n    # Host\n    HOST=\n\n    # Salt sirve para cifrar el ID con HashID, debe ser igual en la API\n    SALT=XXXXXXXXXXXXXXXX\n\n    # Sendgrid\n    SENDGRID_API_KEY=\n    SENDGRID_FROM_EMAIL=\n    SENDGRID_TO_EMAIL_REPORTES=\n\n    # Financieros Vales\n    FIN_VALES_EFIRMA_SER_FIRMA_CADENA_URL=\n    FIN_VALES_EFIRMA_CAN_FIRMA_CADENA_URL=\n    FIN_VALES_EFIRMA_QR_URL=\n    FIN_VALES_EFIRMA_APP_ID=\n    FIN_VALES_EFIRMA_APP_PASS=\n\n    # RRHH Personal API OAuth2\n    RRHH_PERSONAL_API_URL=\n    RRHH_PERSONAL_API_USERNAME=\n    RRHH_PERSONAL_API_PASSWORD=\n\n    # Expediente Virtual API\n    EXPEDIENTE_VIRTUAL_API_URL=\n    EXPEDIENTE_VIRTUAL_API_KEY=\n\n    # Pegaso API cosulta de SIBED\n    PEGASO_API_URL=\n    PEGASO_API_KEY=\n\n    # Si esta en PRODUCTION se evita reiniciar la base de datos\n    DEPLOYMENT_ENVIRONMENT=develop\n\nCree el archivo `.bashrc` para que un perfil de Konsole le facilite la inicializacion\n\n    # pjecz-plataforma-web\n\n    if [ -f ~/.bashrc ]\n    then\n        . ~/.bashrc\n    fi\n\n    if command -v figlet \u0026\u003e /dev/null\n    then\n        figlet PJECZ Plataforma Web\n    else\n        echo \"== PJECZ Plataforma Web\"\n    fi\n    echo\n\n    if [ -f .env ]\n    then\n        echo \"-- Variables de entorno\"\n        export $(grep -v '^#' .env | xargs)\n        echo \"   CLOUD_STORAGE_DEPOSITO: ${CLOUD_STORAGE_DEPOSITO}\"\n        echo \"   CLOUD_STORAGE_DEPOSITO_EDICTOS: ${CLOUD_STORAGE_DEPOSITO_EDICTOS}\"\n        echo \"   CLOUD_STORAGE_DEPOSITO_GLOSAS: ${CLOUD_STORAGE_DEPOSITO_GLOSAS}\"\n        echo \"   CLOUD_STORAGE_DEPOSITO_LISTAS_DE_ACUERDOS: ${CLOUD_STORAGE_DEPOSITO_LISTAS_DE_ACUERDOS}\"\n        echo \"   CLOUD_STORAGE_DEPOSITO_SENTENCIAS: ${CLOUD_STORAGE_DEPOSITO_SENTENCIAS}\"\n        echo \"   CLOUD_STORAGE_DEPOSITO_USUARIOS: ${CLOUD_STORAGE_DEPOSITO_USUARIOS}\"\n        echo \"   DEPLOYMENT_ENVIRONMENT: ${DEPLOYMENT_ENVIRONMENT}\"\n        echo \"   DB_HOST: ${DB_HOST}\"\n        echo \"   DB_PORT: ${DB_PORT}\"\n        echo \"   DB_NAME: ${DB_NAME}\"\n        echo \"   DB_USER: ${DB_USER}\"\n        echo \"   DB_PASS: ${DB_PASS}\"\n        echo \"   FLASK_APP: ${FLASK_APP}\"\n        echo \"   HOST: ${HOST}\"\n        echo \"   REDIS_URL: ${REDIS_URL}\"\n        echo \"   SALT: ${SALT}\"\n        echo \"   SECRET_KEY: ${SECRET_KEY}\"\n        echo \"   TASK_QUEUE: ${TASK_QUEUE}\"\n        echo\n        echo \"   API's Variables\"\n        echo \"   - Expediente Virtual API -\"\n        echo \"   EXPEDIENTE_VIRTUAL_API_URL: ${EXPEDIENTE_VIRTUAL_API_URL}\"\n        echo \"   EXPEDIENTE_VIRTUAL_API_KEY: ${EXPEDIENTE_VIRTUAL_API_KEY}\"\n        echo \"   - Pegaso API cosulta de SIBED -\"\n        echo \"   PEGASO_API_URL: ${PEGASO_API_URL}\"\n        echo \"   PEGASO_API_KEY: ${PEGASO_API_KEY}\"\n        echo\n        export PGHOST=$DB_HOST\n        export PGPORT=$DB_PORT\n        export PGDATABASE=$DB_NAME\n        export PGUSER=$DB_USER\n        export PGPASSWORD=$DB_PASS\n    fi\n\n    if [ -d venv ]\n    then\n        echo \"-- Python Virtual Environment\"\n        source venv/bin/activate\n        echo \"   $(python3 --version)\"\n        export PYTHONPATH=$(pwd)\n        echo \"   PYTHONPATH: ${PYTHONPATH}\"\n        echo\n        echo \"-- Ejecutar Flask o RQ Worker\"\n        alias arrancar=\"flask run --host 0.0.0.0 --port=5003\"\n        alias fondear=\"rq worker ${TASK_QUEUE}\"\n        echo \"   arrancar = flask run --host 0.0.0.0 --port=5003\"\n        echo \"   fondear = rq worker ${TASK_QUEUE}\"\n        echo\n    fi\n\n    if [ -f app.yaml ]\n    then\n        echo \"-- Subir a Google Cloud\"\n        echo \"   gcloud app deploy\"\n        echo\n    fi\n\n## Arrancar Flask\n\nAbra una terminal, cargue el entorno virtual y arranque Flask\n\n    source .bashrc\n    arrancar\n\n## Arrancar RQ worker\n\nLas tareas en el fondo requieren un servicio Redis\n\nAbra una terminal, cargue el entorno virtual y deje en ejecución el worker\n\n    source .bashrc\n    fondear\n\nEstará vigilante de Redis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjecz%2Fpjecz-plataforma-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjecz%2Fpjecz-plataforma-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjecz%2Fpjecz-plataforma-web/lists"}