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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4142014ec7e49043eb4bda8b91f5f9d8a658221f8c35af7da71236b23f46b857 |
|
MD5 | 34935fd792d2a55e6f94aff434cab5f1 |
|
BLAKE2b-256 | 84470661f94fb7f7773315c1e644e679102c520a6c501d71b9864e16e20622f4 |