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.


  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



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.

Files for django-url-or-relative-url-field, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django-url-or-relative-url-field-0.1.2.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page