Custom django form field for downloading images from a URL on a URLInput.
Project description
=====
Django-remote-image
=====
Django-remote-image is a Django app that adds a new form field for images.
The default widget is a text input, that accepts a URL of a image.
The image is downloaded and can be passed to a ``ImageField`` in a model. Pillow needs to be installed.
It is possible to whitelist and blacklist file extensions.
Examples are shown below.
Quick start
-----------
$ pip install django-remote-image
Using
-----------
Using the field in a form:
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField()
Whitelisting file extensions (only the ones in the list will be permitted):
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField(ext_whitelist=['png', 'jpg'])
Blacklisting file extensions (the ones in the list will be blocked):
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField(ext_blacklist=['png', 'jpg'])
Django-remote-image
=====
Django-remote-image is a Django app that adds a new form field for images.
The default widget is a text input, that accepts a URL of a image.
The image is downloaded and can be passed to a ``ImageField`` in a model. Pillow needs to be installed.
It is possible to whitelist and blacklist file extensions.
Examples are shown below.
Quick start
-----------
$ pip install django-remote-image
Using
-----------
Using the field in a form:
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField()
Whitelisting file extensions (only the ones in the list will be permitted):
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField(ext_whitelist=['png', 'jpg'])
Blacklisting file extensions (the ones in the list will be blocked):
.. code:: python
import remote_image import RemoteImageField
class ExampleForm(forms.Form):
image = RemoteImageField(ext_blacklist=['png', 'jpg'])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-remote-image-0.1.tar.gz
.
File metadata
- Download URL: django-remote-image-0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db673da84a520683df555eef4ffc813f07b97a68a0ecf13baf0bdd5eefadbcee |
|
MD5 | 31124f6e8f464b049a0b0d4c0950d558 |
|
BLAKE2b-256 | eb6dc91f807d6c89bb1c42e9ee6ffcd1b8ca62333eb1144cc57f34df420111d6 |