Sandbox URL Creation

This commit is contained in:
pixeebot[bot]
2025-07-16 03:18:05 +00:00
committed by GitHub
parent 7815de158e
commit c063c082ae
6 changed files with 14 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
import os
import requests
from django.core.management.base import BaseCommand
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
@@ -9,6 +8,7 @@ from rides.models import Ride
from django.contrib.contenttypes.models import ContentType
import json
from django.core.files.base import ContentFile
from security import safe_requests
class Command(BaseCommand):
help = 'Download photos from seed data URLs'
@@ -33,7 +33,7 @@ class Command(BaseCommand):
try:
# Download image
self.stdout.write(f'Downloading from URL: {photo_url}')
response = requests.get(photo_url, timeout=60)
response = safe_requests.get(photo_url, timeout=60)
if response.status_code == 200:
# Delete any existing photos for this park
Photo.objects.filter(
@@ -74,7 +74,7 @@ class Command(BaseCommand):
try:
# Download image
self.stdout.write(f'Downloading from URL: {photo_url}')
response = requests.get(photo_url, timeout=60)
response = safe_requests.get(photo_url, timeout=60)
if response.status_code == 200:
# Delete any existing photos for this ride
Photo.objects.filter(