tessl install tessl/pypi-cloudinary@1.44.0Python and Django SDK for Cloudinary, a cloud-based image and video management service with comprehensive transformation, optimization, and delivery capabilities
Agent Success
Agent success rate when using this tile
94%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.08x
Baseline
Agent success rate without this tile
87%
Build a Python script that manages custom URL routing for a cloud-based image gallery. The system should allow administrators to configure how images in different folders are accessed through custom URL patterns.
Implement a script url_manager.py that provides the following functionality:
Create URL Mapping
List All URL Mappings
Update URL Mapping
Delete URL Mapping
Create a test file test_url_manager.py with the following test cases:
# Create a mapping for "products" folder to "http://cdn.example.com/products"
create_mapping("products", "http://cdn.example.com/products")
# List all mappings
mappings = list_mappings()
# Verify the mapping exists in the list
assert any(m['folder'] == 'products' and
m['template'] == 'http://cdn.example.com/products'
for m in mappings)# First create a mapping
create_mapping("gallery", "http://cdn.example.com/gallery")
# Update it with a new URL template
update_mapping("gallery", "http://cdn2.example.com/gallery")
# List and verify the update
mappings = list_mappings()
mapping = next((m for m in mappings if m['folder'] == 'gallery'), None)
assert mapping is not None
assert mapping['template'] == 'http://cdn2.example.com/gallery'# Create a mapping
create_mapping("temp", "http://cdn.example.com/temp")
# Delete it
delete_mapping("temp")
# Verify it's removed
mappings = list_mappings()
assert not any(m['folder'] == 'temp' for m in mappings)Provides cloud-based image and video management capabilities including URL routing configuration.