Metadata-Version: 2.1
Name: django-url-or-relative-url-field
Version: 0.2.0
Summary: This package provides a Django model field that can store both absolute and relative URLs
Home-page: https://github.com/timonweb/django-url-or-relative-url-field
License: MIT
Author: Tim Kamanin
Author-email: tim@timonweb.com
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Dist: django (>=2.2.25)
Description-Content-Type: text/markdown

# 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:

```python
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.

