{"id":44880956,"url":"https://github.com/meeb/django-staticsite","last_synced_at":"2026-02-17T16:05:34.464Z","repository":{"id":324007276,"uuid":"1026527936","full_name":"meeb/django-staticsite","owner":"meeb","description":"Reference implementation of a staticsite contrib module for Django","archived":false,"fork":false,"pushed_at":"2025-11-23T13:37:29.000Z","size":166,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-04T06:37:42.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meeb.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-26T04:29:12.000Z","updated_at":"2025-11-23T14:26:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meeb/django-staticsite","commit_stats":null,"previous_names":["meeb/django-staticsite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/meeb/django-staticsite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meeb%2Fdjango-staticsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meeb%2Fdjango-staticsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meeb%2Fdjango-staticsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meeb%2Fdjango-staticsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meeb","download_url":"https://codeload.github.com/meeb/django-staticsite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meeb%2Fdjango-staticsite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-17T16:05:34.397Z","updated_at":"2026-02-17T16:05:34.459Z","avatar_url":"https://github.com/meeb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-staticsite\n\nA reference implementation of a `staticsite` contrib module for Django.\n\nThis module is currently under development but is functional and ready for testing. Django Static Site is a complete\nground up rebuild of `django-distill`.\n\n`django-staticsite` allows you to generate static sites from Django sites. You can generate full sites to a specified\ndirectory or genereate individual pages on demand. You can also optionally automatically publish generated static sites\nto a configured remote publishing target, for example, Amazon S3 (or any compatible service).\n\n`django-staticsite` is compatible with on-push CI building of static sites allowing for \"serverless\" Django static\nsites with minimal effort.\n\nThis is a reference project designed to show implementation and guage interest. It can be used as a basis for a clean\nPR, if deemed appropriate, in the future. Django Distill has been a third party module for many years and proven to be\nquite popular, potentially the most widely used static site generator framework for Django. Adding its features as an\noptional contrib module would be a logical and useful extension to the \"batteries included\" available contrib features.\n\nIt does not add any excessive complexity, the code should be easily understood and be maintainable.\n\nA functional example of Django Static Site in use and being deployed to Cloudflare Pages can be found here:\n\n* URL: https://django-staticsite-example.meeb.org/\n* Repo: https://github.com/meeb/django-staticsite-example\n\n\n# Notable changes from Django Distill\n\n* Usage of the Django test framework has been replaced with internal WSGI requests\n* Modernisation of the codebase, removal of legacy Python and legacy Django support\n* Type hints and linted (with ruff) and packaged via uv\n* Improved test coverage\n* Broadly compatible with the logic and implementation of Django Distill\n* Switch to using patched `URLPattern`s rather than custom `path(...)` overrides\n* Consolidation of commands into a single `staticsite` command\n* Full support for the same publishing targets as Django Distill\n* Full compatability when integrated with other contrib modules, such as `humanize`, `sitemaps`, `flatpages` etc.\n* Using normal logging and the usual Django logging configuration\n\n\n# Installation for testing\n\n1. Install via pip, uv, poetry, etc. `uv add \"django-staticsite git+https://github.com/meeb/django-staticsite.git\"`\n2. Add to `staticsite` to `INSTALLED_APPS`\n3. Create your static site URL generator functions \n4. Add `staticsite_*` arguments to your URLs in `urls.py`\n5. Create your static site with the `manage.py staticsite generate` command\n\n\n# Optional `settings` added\n\nYou can optionally configure the following settings in your Django project's `settings.py` file when using\n`django-staticsite` - none of these are required:\n\n* `settings.STATICSITE_DIRECTORY` - default directory to generate static sites into\n* `settings.STATICSITE_PUBLISHING_TARGETS` - dictionary of publishing target options\n* `settings.STATICSITE_LANGUAGES` - list of languages to generate static sites for\n* `settings.STATICSITE_SKIP_STATICFILES_DIRECTORIES` - list of directories in `/static/` to skip when generating\n* `settings.STATICSITE_SKIP_ADMIN_DIRECTORIES` - boolean flag to enable skipping of admin directories\n\nExample:\n\n```python\nSTATICSITE_DIRECTORY = BASE_DIR / \"public\"\n\nSTATICSITE_PUBLISHING_TARGETS = {\n    \"test-s3-container\": {\n        \"ENGINE\": \"staticsite.publishers.amazon_s3\",\n        \"PUBLIC_URL\": \"https://some-public-url/\",\n        \"ACCESS_KEY_ID\": \"some-access-key\",\n        \"SECRET_ACCESS_KEY\": \"some-secret-key\",\n        \"BUCKET\": \"some-bucket\",\n        \"ENDPOINT_URL\": \"https://some-endpoint-url/\",\n        \"DEFAULT_CONTENT_TYPE\": \"application/octet-stream\",\n    }\n}\n\nSTATICSITE_LANGUAGES = [\"en\", \"fr\", \"de\"]\n\nSTATICSITE_SKIP_STATICFILES_DIRS = [\"a_directory\", \"another_directory\"]\n\nSTATICSITE_SKIP_ADMIN_DIRS = True\n```\n\n# Still to do\n\n* Full testing for publishing targets (requires creating some Azure accounts etc.)\n\n\n# Steps required for further integration\n\nDjango StaticSite, if integrated as a contrib module, would need some minor additional parameters added to `URLPattern`\nclasses to store some addtional static URL information. Currently, for testing, this is implemented via some monkey\npatching to have a working implementation without requiring core Django patches. The suggested additions have no impact\non existing sites, no changes to existing APIs and no impact on performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeeb%2Fdjango-staticsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeeb%2Fdjango-staticsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeeb%2Fdjango-staticsite/lists"}