
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
django-urlconfchecks
Advanced tools
django-urlconfchecks is a static type checker that checks your URLconf parameter types with argument types specified in associated views. It leverages the Django's static check system.
pip install django-urlconfchecks
Python 3.7 or later is required. However, before Python 3.10 some checks
relating to Optional
types in view signatures are skipped due to stdlib
limitations.
You can use this package in different ways:
Add django_urlconfchecks
to your INSTALLED_APPS
list in your settings.py
file.
INSTALLED_APPS = [
...
'django_urlconfchecks',
]
Run this command from the root of your project, were manage.py
is located:
$ urlconfchecks --help
Usage: urlconfchecks [OPTIONS]
Check all URLConfs for errors.
Options:
--version
-u, --urlconf PATH Specify the URLconf to check.
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or
customize the installation.
--help Show this message and exit.
Add the following to your .pre-commit-config.yaml
file:
- repo: https://github.com/AliSayyah/django-urlconfchecks
rev: v0.10.0
hooks:
- id: django-urlconfchecks
For more information, see the usage documentation.
Using this package, URL pattern types will automatically be matched with associated views, and in case of mismatch, an error will be raised.
Example:
# urls.py
from django.urls import path
from . import views
urlpatterns = [
path('articles/<str:year>/', views.year_archive),
path('articles/<int:year>/<int:month>/', views.month_archive),
path('articles/<int:year>/<int:month>/<slug:slug>/', views.article_detail),
]
# views.py
def year_archive(request, year: int):
pass
def month_archive(request, year: int, month: int):
pass
def article_detail(request, year: int, month: int, slug: str):
pass
output will be:
(urlchecker.E002) For parameter `year`, annotated type int does not match expected `str` from urlconf
typing.List[int]
, list[str]
etc.FAQs
a python package for type checking the urls and associated views.
We found that django-urlconfchecks 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
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.