{"id":27243721,"url":"https://github.com/roskakori/django-reporting-with-raw-sql","last_synced_at":"2026-04-28T08:02:24.200Z","repository":{"id":286578976,"uuid":"961575741","full_name":"roskakori/django-reporting-with-raw-sql","owner":"roskakori","description":"Code and slides for talk at PyCon Austria 2025","archived":false,"fork":false,"pushed_at":"2025-04-07T17:16:31.000Z","size":3796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T20:58:32.320Z","etag":null,"topics":["django","example","reporting","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roskakori.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,"zenodo":null}},"created_at":"2025-04-06T19:44:11.000Z","updated_at":"2025-04-07T17:16:35.000Z","dependencies_parsed_at":"2025-04-10T20:58:23.366Z","dependency_job_id":null,"html_url":"https://github.com/roskakori/django-reporting-with-raw-sql","commit_stats":null,"previous_names":["roskakori/django-reporting-with-raw-sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roskakori/django-reporting-with-raw-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roskakori%2Fdjango-reporting-with-raw-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roskakori%2Fdjango-reporting-with-raw-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roskakori%2Fdjango-reporting-with-raw-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roskakori%2Fdjango-reporting-with-raw-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roskakori","download_url":"https://codeload.github.com/roskakori/django-reporting-with-raw-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roskakori%2Fdjango-reporting-with-raw-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["django","example","reporting","sql"],"created_at":"2025-04-10T20:58:20.018Z","updated_at":"2026-04-28T08:02:24.194Z","avatar_url":"https://github.com/roskakori.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django reporting with raw SQL\n\nThis is a Python Django example application to show how to perform Django reporting by means of raw SQL and database views.\n\n## Environment settings\n\nThe project requires an environment file named `.env` to know about the [PostgreSQL](https://www.postgresql.org/) database settings and the preferred default password for demo data.\n\nFor example:\n\n```dotenv\n# The default password for demo data.\nMT_DEFAULT_PASSWORD=\"deMo.123\"\n\n# PotgreSQL database connection\nMT_POSTGRES_HOST=localhost\nMT_POSTGRES_PORT=5422\nMT_POSTGRES_DATABASE=minitrack_local\nMT_POSTGRES_USERNAME=minitrack_local\nMT_POSTGRES_PASSWORD=${MT_DEFAULT_PASSWORD}\n```\n\n### PostgreSQL from docker container\n\nBy default, the application will connect to a local server running on port 5432 to a database `minitrack_local` with a user `minitrack_local` and the password `deMo.123`. The repository includes a `compose.yaml` which can be used with [Docker](https://www.docker.com/):\n\n```bash\ndocker compose up\n```\n\n### Existing PostgreSQL server\n\nIf you already have access to an existing Postgre server, specify the settings in the `.env`.\n\n## Project setup\n\nThe project requires [uv](https://docs.astral.sh/uv/).\n\nTo set up the project, run:\n\n```bash\nuv sync --group dev\n```\n\nIn order to keep code clean even after your own modifications, activate the pre-commit hooks:\n\n```bash\nuv run pre-commit install --install-hooks\n```\n\nNext, apply the database migrations:\n\n```bash\nuv run python manage.py migrate\n```\n\nAfter that, create an admin user to log in. The fastest way for that is:\n\n```bash\nuv run python manage.py make_demo_admin\n```\n\nThis adds an admin user named \"admin\" with the password specified with the environment variable `MT_DEFAULT_PASSWORD` (default: \"deMo.123\").\n\nAlternatively, you can use the standard management command `createsuperuser` and specify all the details yourself:\n\n```bash\nuv run python manage.py createsuperuser --username admin\n```\n\nThen run the server\n\n```bash\nuv run python manage.py runserver\n```\n\nNow connect to \u003chttp://localhost:8000/\u003e and use the login from the `createsuperuser` from above.\n\nYou can use the admin UI to create and edit data.\n\nTo get you started quickly, create a few random demo data by running:\n\n```bash\nuv run python manage.py make_demo\n```\n\n## License\n\nCopyright (c) 2025 Thomas Aglassinger. Distributed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froskakori%2Fdjango-reporting-with-raw-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froskakori%2Fdjango-reporting-with-raw-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froskakori%2Fdjango-reporting-with-raw-sql/lists"}