Skip to main content

Django checks to ensure valid URL Configurations

Project description

PyPI Version Python Versions Django Versions Build Status codecov BCH compliance

Read Me

Use Django's System Check Framework to ensure your URL Configuration works correctly.

Table of Contents

Project Purpose

This package checks your Django project's URL Configuration for a few things.

  • Do the paths or regular expressions in your URL configuration tree end with slashes (or, for regular expressions, /$)
  • Is the URL configuration tree comprised of only URLPattern and URLResolver instances (path() and include())?
  • Is ROOT_URLCONF defined in settings, and does it point to a valid Python module with urlpatterns defined?

🔝 Up to Table of Contents

Project Rationale

I constantly forget to add a slash to the end of my URI paths. This leads to strange behavior, and can be tricky to catch even with proper testing.

What's more, the errors raised when something is amiss with the URL configuration can be tricky to debug and understand.

As such, this package aim to try and make developers lives easier by providing targeted checks of the URL configuration tree. This is meant to be used as part of a "belt-and-braces" approach, and is not a substitution for tests!

I am open to suggestions on improving the checks. Please open an issue to do so.

🔝 Up to Table of Contents

Installation and Usage

  1. Add "url_checks.apps.UrlChecksConfig", as an item in your Django project's INSTALLED_APPS setting
  2. In the terminal (in your Django projects code-root directory), run Django's check framework with $ python manage.py check
  3. Read the output in your terminal and track those bugs down!

🎉

🔝 Up to Table of Contents

Contributing

For ideas, bugs, feature-requests, and all the rest, please open an issue on Github.

🔝 Up to Table of Contents

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-url-checks-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

django_url_checks-0.2.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file django-url-checks-0.2.0.tar.gz.

File metadata

  • Download URL: django-url-checks-0.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.7.0 Darwin/18.2.0

File hashes

Hashes for django-url-checks-0.2.0.tar.gz
Algorithm Hash digest
SHA256 28fe60c92a35442edb19a7ad0c622d4bfbe3852ce16893a9fc14cbb64ea19926
MD5 48fa5a8ed357b74c94a9b86a779f24ce
BLAKE2b-256 c458aea3e10cbec7fc3ca5d6da0a254e681c4f587ed5d0e4bee80b1083022647

See more details on using hashes here.

File details

Details for the file django_url_checks-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_url_checks-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dca4b930d9fec8020d2121e6715f1aecdd36773a291616f84ba083e38957e546
MD5 802e3518d8a06034985ed91403c05ce3
BLAKE2b-256 e236947d1b1a7ad285741f389d25a586684ca7bc1463ce39457811dd3b2986ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page