
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
django-typescript-routes
Advanced tools
Meant as a spiritual successor to django-js-reverse, django-typescript-routes
is meant to answer to the following question:
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?
django-typescript-routes
is how! At a high level, it turns:
urls = [
path(
r"about",
about,
name="about",
),
path(
r"/<str:username>",
subscribe,
name="subscribe",
),
path(
r"/<str:username>/subscribers/<pk:uuid>/success",
subscription_success,
name="subscription-success",
),
]
into:
const URLS = {
about: () => `/`,
subscribe: (username: string) => `/${username}`,
"subscription-success": (username: string, pk: string) =>
`/${username}/subscribers/${pk}/success`,
};
uv add django-typescript-routes
django-typescript-routes
to your INSTALLED_APPS
setting:INSTALLED_APPS = [
...,
"typescript_routes",
...
]
python manage.py generate_typescript_routes --urlconf projectname.urls > assets/urls.ts
Simply:
./scripts/test
FAQs
Generate typescript routes from a Django URLconf
We found that django-typescript-routes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.