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:
```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.
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.
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
Close
Hashes for django-url-or-relative-url-field-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbdff73568f9e8411755b8d55ca5daf7daf9cc210ac2ee84d125a26fd02475cd |
|
MD5 | 0b5a2a2d4283f36f1e303d679e7a8a47 |
|
BLAKE2b-256 | efd0614d961a1d9a563aafd3a859a2ef7444f609f252ea50b5ca1fdb6cefe589 |