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
-
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 .
. -
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
- Download URL: django-url-or-relative-url-field-0.2.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa28b5a7f11b132b1714ac609f981f9ec664e495ecbfa13c6adda1ab8ae88464 |
|
MD5 | e249b450615ecd09803181ed7190d7c2 |
|
BLAKE2b-256 | 3fec2b7f2ec6de479a56672310b06ab7cf5d66964a3d3de9c797cc05441129eb |
File details
Details for the file django_url_or_relative_url_field-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_url_or_relative_url_field-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a26d04afdd079fb5b5d3a0adadaf748916d7a5865d383a29fb16a42070b8b1 |
|
MD5 | 31f20be7ee4197e71117bea6a0c2ef29 |
|
BLAKE2b-256 | 6dfefefbd05c0d6c3351886d4c67b41969faf79c3f479d3419754cc607630e7e |