Skip to main content

This package provides a Django model field that can store both absolute and relative URLs

Project description

Django URL or Relative URL Field

This package extends default Django URLField to support relative URLs.

Installation

  1. Install the python package django-url-or-relative-url-field from pip:

    pip install django-url-or-relative-url-field

    Alternatively, you can install download or clone this repo and call pip install -e ..

  2. Add to INSTALLED_APPS in your settings.py:

    'url_or_relative_url_field',

Usage

Add field to the model:

from django.db import models
from url_or_relative_url_field.fields import URLOrRelativeURLField

class Redirect(models.Model):
   url = URLOrRelativeURLField()

Now your model will accept both absolute and relative URLs into the url field.

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

Built Distribution

File details

Details for the file django-url-or-relative-url-field-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-url-or-relative-url-field-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aa28b5a7f11b132b1714ac609f981f9ec664e495ecbfa13c6adda1ab8ae88464
MD5 e249b450615ecd09803181ed7190d7c2
BLAKE2b-256 3fec2b7f2ec6de479a56672310b06ab7cf5d66964a3d3de9c797cc05441129eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_url_or_relative_url_field-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42a26d04afdd079fb5b5d3a0adadaf748916d7a5865d383a29fb16a42070b8b1
MD5 31f20be7ee4197e71117bea6a0c2ef29
BLAKE2b-256 6dfefefbd05c0d6c3351886d4c67b41969faf79c3f479d3419754cc607630e7e

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