Skip to main content

django-smarturlfield

Django model and form fields that performs URL normalization. For example it adds ‘http://’ prefix and forces punicode encoding. There are also fields that stores a list of URLs.

Tested with Django 3.0.x (should also work for 2.x)

Travis-CI build status

Installing

$ pip install django-smarturlfield

Fields

SmartURLFormField renders as <input> and can handle values like this:

  • http://example.com

  • example.com (normalized to http://example.com)

  • земфира.рф (normalized to http://xn--80ajfftz0a.xn--p1ai)

MultipleSmartURLFormField renders as <textarea> and can store multiple URLs separated by newline.

Usage

In forms:

from smarturlfield import SmartURLFormField, MultipleSmartURLFormField

class MyForm(forms.Form):
  url = SmartURLFormField()
  url_list = MultipleSmartURLFormField()  # textarea
  # ...

In models:

from smarturlfield import SmartURLDbField, MultipleSmartURLDbField

class MyModel(models.Model):
    url = SmartURLDbField()
    url_list = MultipleSmartURLDbField()  # textarea
    # ...

Metadata

Release files for django-smarturlfield 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-smarturlfield 1.1.1
File Size Uploaded Provenance Actions
django-smarturlfield-1.1.1.tar.gz 4.0 kB Without provenance Details for django-smarturlfield-1.1.1.tar.gz

Release files / django-smarturlfield-1.1.1.tar.gz

Download URL django-smarturlfield-1.1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9da0b61914a8b36e15d5d3e268b494da2098c9e03d6386dde009bafe1c85c100
BLAKE2b-256 checksum
How to use checksums
451f6406013e0f483d7a327b7f6d39a73c802072fc501da14407f90715dd9841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Security for django-smarturlfield 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page