geex-arts / django-jet

Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo
https://github.com/jet-admin/jet-bridge
GNU Affero General Public License v3.0
3.58k stars 775 forks source link

.tiff and .woff Icons not displaying using S3 #415

Open drewburnett opened 4 years ago

drewburnett commented 4 years ago

When I use AWS s3, admin requests static/jet/css/icons/fonts/jet-icons.ttf?415d6s & static/jet/css/icons/fonts/jet-icons.woff?415d6 but s3 changes these file urls to static/jet/css/icons/fonts/jet-icons.ttf%3415d6s and static/jet/css/icons/fonts/jet-icons.woff%3415d6 accordingly. Any suggestions?

ljluestc commented 8 months ago
from urllib.parse import urlencode

# Assuming you have the original URL and query parameters
original_url = "static/jet/css/icons/fonts/jet-icons.ttf"
query_params = {"param": "415d6s"}

# Encode the query parameters
encoded_params = urlencode(query_params)

# Construct the final URL with encoded query parameters
final_url = f"{original_url}?{encoded_params}"