{"id":16417319,"url":"https://github.com/buttondown/django-typescript-routes","last_synced_at":"2026-04-06T09:11:56.750Z","repository":{"id":189005924,"uuid":"679860183","full_name":"buttondown/django-typescript-routes","owner":"buttondown","description":"Generate Typescript routes from a Django URLconf","archived":false,"fork":false,"pushed_at":"2025-07-13T20:12:02.000Z","size":32,"stargazers_count":37,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T16:36:54.189Z","etag":null,"topics":["django","python","typescript"],"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/buttondown.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-08-17T19:27:17.000Z","updated_at":"2025-12-06T15:50:19.000Z","dependencies_parsed_at":"2024-10-16T22:04:12.031Z","dependency_job_id":"ac3f26e3-9314-4147-a216-a759831a8935","html_url":"https://github.com/buttondown/django-typescript-routes","commit_stats":null,"previous_names":["buttondown-email/django-typescript-routes","buttondown/django-typescript-routes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/buttondown/django-typescript-routes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buttondown%2Fdjango-typescript-routes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buttondown%2Fdjango-typescript-routes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buttondown%2Fdjango-typescript-routes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buttondown%2Fdjango-typescript-routes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buttondown","download_url":"https://codeload.github.com/buttondown/django-typescript-routes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buttondown%2Fdjango-typescript-routes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31466228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: 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":["django","python","typescript"],"created_at":"2024-10-11T07:11:26.330Z","updated_at":"2026-04-06T09:11:56.727Z","avatar_url":"https://github.com/buttondown.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# django-typescript-routes\n\nMeant as a spiritual successor to [django-js-reverse](https://pypi.org/project/django-js-reverse/), `django-typescript-routes` is meant to answer to the following question:\n\n\u003e I've got a Typescript-based SPA that is powered by a Django-based API. How do I safely make requests to Django without messing up the routes or parameters?\n\n`django-typescript-routes` is how! At a high level, it turns:\n\n```python\nurls = [\n    path(\n        r\"about\",\n        about,\n        name=\"about\",\n    ),\n    path(\n        r\"/\u003cstr:username\u003e\",\n        subscribe,\n        name=\"subscribe\",\n    ),\n    path(\n        r\"/\u003cstr:username\u003e/subscribers/\u003cpk:uuid\u003e/success\",\n        subscription_success,\n        name=\"subscription-success\",\n    ),\n]\n```\n\ninto:\n\n```typescript\nconst URLS = {\n  about: () =\u003e `/`,\n  subscribe: (username: string) =\u003e `/${username}`,\n  \"subscription-success\": (username: string, pk: string) =\u003e\n    `/${username}/subscribers/${pk}/success`,\n};\n```\n\n## Quick start\n\n1. Install:\n\n```bash\nuv add django-typescript-routes\n```\n\n1. Add `django-typescript-routes` to your `INSTALLED_APPS` setting:\n\n```python\nINSTALLED_APPS = [\n    ...,\n    \"typescript_routes\",\n    ...\n]\n```\n\n2. Run the management command to print out the typescript file:\n\n```bash\npython manage.py generate_typescript_routes --urlconf projectname.urls \u003e assets/urls.ts\n```\n\n## Contributing\n\n### Running the test suite\n\nSimply:\n\n```\n./scripts/test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttondown%2Fdjango-typescript-routes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuttondown%2Fdjango-typescript-routes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttondown%2Fdjango-typescript-routes/lists"}