By Chris
Hi, there
I have enabled video uploads in my Django social media project. It works fine in my local computer, and when I pushed the refactored code to Digital Ocean app, the video uploads give me a 500 error. It only happens with the video uploads, but when I upload the video from Django admin I don’t get an an error and I can see it in the spaces bucket as well as the browser/template and I can play it.
I suspect error is server side.
Here is my settings.py please check it for me do I need to do something special for the video upload?
There is a lot of commented out code please ignore that:
# MEDIA_URL = '/media/'
# MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# STATICFILES_DIRS = [os.path.join(BASE_DIR, 'soccerfamly/static')]
# Static files (CSS, JavaScript, images)
STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
# DigitalOcean Spaces configuration for static and media files
AWS_ACCESS_KEY_ID = config('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = config('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = 'spportsfamly-images'
AWS_S3_ENDPOINT_URL = 'https://spportsfamly-images.sfo3.digitaloceanspaces.com'
AWS_LOCATION = ''
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_DEFAULT_ACL = 'public-read'
AWS_QUERYSTRING_AUTH = False
# Static files storage configuration
STATIC_URL = f'https://{AWS_S3_ENDPOINT_URL}/{AWS_LOCATION}/'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# Media files storage configuration
MEDIA_URL = f'https://{AWS_S3_ENDPOINT_URL}/{AWS_LOCATION}/media/'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# Other settings
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya @chrismlalazi,
It’s going to be really hard to tell without actual logs, the logs should provide you with a detailed error.
Check this article here:
https://docs.digitalocean.com/products/app-platform/how-to/view-logs/
Once you know the exact error it should be easier to troubleshoot.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.