I have a problem related with uploading images directly to object storage Swift, using Django Rest Framework.
Most of tutorials present simple upload images to /media/ directory in localhost, but this option is not going to fit in my project.
Tried use django-storage-swift - https://github.com/blacktorn/django-storage-swift . While doing requests using httpie, I received in 50% of requests an error:
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:600)
[06/Jun/2017 13:03:01] "POST /api/processing_raw_files/ HTTP/1.1" 500 24946
This makes, that only half of uploading files will be in fact sending to the cloud.
I am working on
Ubuntu 14.04
Python 3.4.3
Django 1.11
djangorestframework 3.6.2
django-storage-swift 1.2.16
Do you know any other possibility how can I upload images using swift and django rest? Or did you face with ssl error utilizing django-storage-swift?
Related
I'm working on a react-native app witch contains some videos, and when I put in source the uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4', from google samples, it actually works, but if I try to put a uri for a video contained in my django media folder, the following error occur: The server is not correctly configured. - The AVPlayerItem instance has failed with the error code -11850 and domain "AVFoundationErrorDomain".
How can I solve? Thank you
This is because AVFoundation is using byte range requests which is not supported by Django out of the box.
Add this to your middleware: https://github.com/AidenEllis/DjangoRangeMiddleware
Related: Byte Ranges in Django
My Django site was working fine at localhost:8000 but when I uploaded to Heroku, the charts no longer show up. Is there any typical reason why this would be? The errors I received in the console were Uncaught Error: Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com and The page at 'https://...com/' was loaded over HTTPS, but requested an insecure script 'http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js'. This request has been blocked; the content must be served over HTTPS.
the error says it all. You try to load in the moment script over http but since this is an insecure protocol oit has been blocked, you have to load in the script over https.
https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js
Our Django App is failing media upload. This has been an off-and-on issue for us for a while. however, for about a week now, it's been consistently failing to upload media. Our media files are stored on S3.
On inspection, the uploaded files were found in the S3 buckets... However, the logs display the message below while the app throws an Application error...
Found this answer on GitHub (https://github.com/benoitc/gunicorn/issues/840)
Hi, we hit this issue in production using Flask + Gunicorn + Heroku and couldn't find a cause or a workaround.
For one particular POST request with POST parameters, the request would fail with an H18 error (sock=backend) in Heroku's router indicating that the server closed the socket when it shouldn't have.
We started decreasing the response size of that failing endpoint until we narrowed it down to around the 13k mark. If we sent less than 13k, the response would always work. If we sent more than 13k, the response would almost always not work.
Code to reproduce this is available at https://github.com/erjiang/gunicorn-issue - just deploy the repo to Heroku as is and follow the instructions in the README.
I am using the cloudinary sample django project:
https://github.com/cloudinary/cloudinary-django-sample
I made the following changes:
- using django 1.8.6
- using cloudinary 1.4.0
- added CLOUDINARY_URL environment variable
- added cloudinary_cors.html file (provided by cloudinary) in static/html directory
I can perform server-side upload and everything works fine.
When I perform browser upload (signed or unsigned), the image selected uploads to my cloudinary account successfully, but the cloudinarydone event never occurs and the browser doesn't resister a successful upload.
Instead, I am getting this error in the browser console:
XMLHttpRequest cannot load https://api.cloudinary.com/v1_1/[namespace]/auto/upload. The request was redirected to 'localhost:8000/static/html/cloudinary_cors.html?bytes=4304&created_a…s=%23%3CSet%3A0x0000000ab0e050%3E&type=upload&version=[num]&width=402', which is disallowed for cross-origin requests that require preflight.
I would think the POST doesn't require a preflight CORS request. I have seen other posts online about the preflight error, and it seems some of them were resolved by fixing javascript imports. My order is:
1. jQuery
2. uiwidget
3. iframe-transport
4. fileUpload
5. cloudinary.js
which seems correct based on said posts.
What am I doing wrong? What do I need to change to get the cloudinarydone event?
we're working on a fix for this issue.
Meantime, in upload.html you should replace the following line:
.fileupload({
with
.cloudinary_fileupload({
This should solve the issue for you.
Server Spec:
Wordpress 3.0.1
PHP Version 5.3.8-1+b1
MYSQL 5.1
Apache/2.3.16
Linux
The Problem
Simple really. A website that I helped to build and install a while back has just been transferred to a new host. The front end of the website isn't presenting any issues, but when I try to login to the admin area, I get a 501 'Unsupported Method ('POST') error.
I'm a bit lost, my guess would be it's a server config issue, but are there any specific wordpress issues that might be at fault?