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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
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.