{"id":19167677,"url":"https://github.com/nnnlik/djangopdfmaker","last_synced_at":"2026-04-09T22:49:34.224Z","repository":{"id":207608499,"uuid":"719658422","full_name":"nnnLik/djangopdfmaker","owner":"nnnLik","description":"This is a service designed to generate PDF files from a URL or HTML file. The service is built using Django, Django Rest Framework (DRF), Docker and Celery.","archived":false,"fork":false,"pushed_at":"2023-12-23T20:35:27.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T23:12:27.313Z","etag":null,"topics":["celery","django","flake8","poetry","postgres","pre-commit-hook","redis","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nnnLik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-16T16:23:27.000Z","updated_at":"2023-11-29T10:08:58.000Z","dependencies_parsed_at":"2024-11-13T09:00:16.922Z","dependency_job_id":null,"html_url":"https://github.com/nnnLik/djangopdfmaker","commit_stats":null,"previous_names":["nnnlik/djangopdfmaker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fdjangopdfmaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fdjangopdfmaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fdjangopdfmaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnLik%2Fdjangopdfmaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnnLik","download_url":"https://codeload.github.com/nnnLik/djangopdfmaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240247664,"owners_count":19771352,"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":["celery","django","flake8","poetry","postgres","pre-commit-hook","redis","unit-testing"],"created_at":"2024-11-09T09:38:52.069Z","updated_at":"2026-04-09T22:49:34.171Z","avatar_url":"https://github.com/nnnLik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django PDF Maker\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://github.com/nnnLik/djangopdfmaker/actions/workflows/django-tests.yaml\"\u003e\n        \u003cimg src=\"https://github.com/nnnLik/djangopdfmaker/actions/workflows/django-tests.yaml/badge.svg?branch=master\"\u003e\n    \u003ca href=\"https://github.com/python/cpython\"\u003e\n     \u003cimg src=\"https://img.shields.io/badge/Python-3.11-FF1493.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/nnnLik/social_network-django\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/repo-size/nnnLik/social_network-django\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis is a service designed to generate PDF files from a URL or HTML file. The service is built using Django, Django Rest Framework (DRF), Docker and Celery.\n\n### Project Structure\n\nThe project includes the following components:\n\n* Django: Web framework.\n* Postgres: Database\n* Celery: Task queue\n* Redis: Message Broker, for Celery.\n* Flower: Celery monitoring tool\n\n### Continuous Integration (CI)\n\nAfter each push to the main branch, a Continuous Integration (CI) pipeline is triggered. This pipeline includes the following steps:\n\n1. __Linting__: The code is checked for adherence to coding standards using a linter.\n2. __Testing__: The test suite is executed to ensure the functionality of the application.\n\n### Installation\n\n1. Clone the repository to your local machine.\n\n2. Create an .env file in the root directory with the following contents:\n```\n# server\nSECRET_KEY=sadpweomdonebicuvceuhbijcn\nDEBUG=True\n\n# database\nDB_ENGINE=django.db.backends.postgresql\nDB_NAME=postgres\nDB_USER=postgres\nDB_PASSWORD=postgres\nDB_HOST=database\nDB_PORT=5432\n\nPOSTGRES_PASSWORD=postgres\nPOSTGRES_USER=postgres\nPOSTGRES_DB=postgres\nPOSTGRES_PORT=5432\n\n# celery\nCELERY_BROKER_URL=redis://redis:6379\nCELERY_RESULT_BACKEND=redis://redis:6379\n```\n\n3. Build and run\n```bash\ndocker-compose up --build\n```\n\n### Weekly cleanup task\n\nA weekly task to delete old PDF and HTML files has been added to keep the system up to date. Perhaps in the future, instead of deleting old files, they can be put into a zip archive\n\n### Usage\n\n* Access the admin panel at /admin with the following credentials:\n```bash\nUsername: admin\nPassword: admin\n```\n\n* Swagger documentation is available at /swagger/.\n\n### Endpoints\n\n1. Generate PDF:\n\n    * Endpoint: POST /api/core/generate-pdf/\n    * Request: Submit either an HTML file or a URL.\n    * Response:\n\n\n```json\n{\n    \"task_id\": \"2da82d6c-13a3-455d-a555-9d3c95caad5a\",\n    \"result\": \"Processing started.\"\n}\n```\n\n2. Check Task Status:\n\n    * Endpoint: GET /api/core/tasks/{task_id}/\n    * Response:\n\n```json\n{\n    \"id\": \"2da82d6c-13a3-455d-a555-9d3c95caad5a\",\n    \"generated_pdf\": {\n       \"id\": 32,\n       \"pdf_file\": \"/media/generated_pdfs/2da82d6c-13a3-455d-a555-9d3c95caad5a.pdf\",\n       \"created_at\": \"17.11.2023 06:02:16\"\n       },\n    \"status\": \"COMPLETED\" | \"IN_PROGRESS\" | \"ERROR\",\n    \"status_message\": \"Task completed successfully.\",\n    \"source\": \"...\",\n    \"created_at\": \"17.11.2023 06:01:45\",\n    \"updated_at\": \"17.11.2023 06:01:45\"\n}\n```\n\n### Testin\n\nRun the tests using the following command:\n\n```bash\ndocker exec -it djangopdfmaker ./manage.py test\n```\n\n### TODO\n* [ ] Setup the default source size (kb)\n* [ ] Tracking the celery tasks status by callbacks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnlik%2Fdjangopdfmaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnnlik%2Fdjangopdfmaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnlik%2Fdjangopdfmaker/lists"}