Add images to Wagtail via URL - A production-ready plugin for importing images from external URLs
Project description
🖼️ Wagtail Image From URL
A powerful and user-friendly Wagtail plugin that enables you to import images directly from URLs into your Wagtail image library without the need to manually download them first. Perfect for content editors who need to quickly add images from external sources.
✨ Features
🚀 Core Functionality
- Bulk URL Import: Add multiple images simultaneously by providing multiple URLs in a single form submission.
- Direct Integration: Seamlessly integrates into the Wagtail admin interface
- Real-time Feedback: Inline status indicators show success/failure for each URL
- Beautiful UI: Modern, responsive design with smooth animations and transitions
- Smart Validation: Client-side and server-side URL validation
- File size limit: Each imported image is limited to a maximum size of 10 MB (to avoid excessively large downloads and memory usage).
🎨 User Experience
- Intuitive Interface: Clean, modern UI that follows Wagtail design patterns
- Batch Processing: Submit multiple URLs with a single click
- Dynamic Field Management: Add or remove URL fields on the fly
- Visual Feedback: Success/error messages with icons
- Responsive Design: Works perfectly on desktop and mobile devices
- No Page Reload: AJAX-based submission for smooth user experience
📋 Requirements
- Python: 3.10 or higher
- Django: 4.2 or higher
- Wagtail: 5.0 or higher
- Additional Dependencies:
requests- For HTTP operationsPillow- For image validation and processing
- Max image size: 10 MB per image (the plugin validates file sizes and will reject images larger than this limit)
📦 Installation
Step 1: Install the Package
Install from PyPI:
pip install wagtail-image-from-url
Alternatively, install from GitHub:
pip install git+https://github.com/awais786/wagtail-image-from-url.git@main
Step 2: Add to Installed Apps
Add image_url_upload to your Django INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
# ... other apps
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail',
'image_url_upload', # ← Add this line
# ... other apps
]
That's it! The package is ready to use. Static files will be automatically discovered by Django's staticfiles system.
🎯 Usage
Quick Start
-
Navigate to Images: Go to the Wagtail admin and click on "Images" in the sidebar
-
Click "Add an Image from URL": You'll see a new button in the images index page header
-
Enter Image URLs:
- Enter one or more image URLs (you can add multiple URLs in the same form to perform a bulk import).
- Each image must be 10 MB or smaller — larger files will be rejected by the plugin.
- Click "Add Another URL" to add more fields
- Remove unwanted fields using the trash icon
-
Fetch Images: Click the "Fetch All Images" button to import all images at once
-
View Results: See real-time status updates next to each URL field
🧪 Testing
The project includes comprehensive tests. To run them:
# Install test dependencies separately
pip install pytest pytest-django
# Run tests
pytest
🛠️ Development Setup
# Clone the repository
git clone https://github.com/awais786/wagtail-image-from-url.git
cd wagtail-image-from-url
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install package in editable mode
pip install -e .
# Install test/development tools (optional)
pip install pytest pytest-django black flake8
# Run tests
pytest
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wagtail Slack: Find us in the #packages channel
📊 Changelog
Version 1.0.1 (Current)
- ✨ Production-ready release
- ✅ Bulk URL import functionality
- ✅ Real-time status feedback
- ✅ Support for JPEG, PNG, GIF, BMP, and WEBP formats
- ✅ 10 MB file size limit
- ✅ Smart filename extraction with fallbacks
- ✅ Content-type validation
- ✅ Timeout protection (10 seconds)
- ✅ Comprehensive error handling
For detailed changelog, see CHANGELOG.md
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
⭐ Star on GitHub | 🐛 Report Bug | 💡 Request Feature
Made with ❤️ for the Wagtail community
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_image_from_url-1.0.2.tar.gz.
File metadata
- Download URL: wagtail_image_from_url-1.0.2.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86d19463ae7eef057daa99b165aadcb03ca8c51bb73d78173c9a418dd00e5a5d
|
|
| MD5 |
a27fcbb7665ddfc7cf8df30b5eb6831e
|
|
| BLAKE2b-256 |
94496b8466c562fd0a7b9dc450fdf88e451f9b4cead9779f4ab4edd925b9db00
|
Provenance
The following attestation bundles were made for wagtail_image_from_url-1.0.2.tar.gz:
Publisher:
publish.yml on awais786/wagtail-image-from-url
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_image_from_url-1.0.2.tar.gz -
Subject digest:
86d19463ae7eef057daa99b165aadcb03ca8c51bb73d78173c9a418dd00e5a5d - Sigstore transparency entry: 670068775
- Sigstore integration time:
-
Permalink:
awais786/wagtail-image-from-url@7dd06e16f543759c074a17f527f27769a7d25ccd -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/awais786
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7dd06e16f543759c074a17f527f27769a7d25ccd -
Trigger Event:
release
-
Statement type:
File details
Details for the file wagtail_image_from_url-1.0.2-py3-none-any.whl.
File metadata
- Download URL: wagtail_image_from_url-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24aedf3c60cb4d2bcedfdb22243f76a4d6ffca0a4a4764fff04c9d5dc61406a5
|
|
| MD5 |
89c64b3b0212f370ceef8063f44b59f8
|
|
| BLAKE2b-256 |
c6976177de12bee0fc8010b2e412cbdb789c372d31357924f30f65a3d1a9e92e
|
Provenance
The following attestation bundles were made for wagtail_image_from_url-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on awais786/wagtail-image-from-url
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wagtail_image_from_url-1.0.2-py3-none-any.whl -
Subject digest:
24aedf3c60cb4d2bcedfdb22243f76a4d6ffca0a4a4764fff04c9d5dc61406a5 - Sigstore transparency entry: 670068836
- Sigstore integration time:
-
Permalink:
awais786/wagtail-image-from-url@7dd06e16f543759c074a17f527f27769a7d25ccd -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/awais786
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7dd06e16f543759c074a17f527f27769a7d25ccd -
Trigger Event:
release
-
Statement type: