Project description
-User upload videos from local with uploading page where you can enter name, description, video, uploaded time -I use Cloudflare stream upload API( https://developers.cloudflare.com/stream/uploading-videos/upload-video-file/) to upload video from local. For this, we need to create an api endpoint, headers( with authentication),and files( open and read file from local), and send a POST request to the api endpoint. We retrieve the video UID, watchable URL from the response. Once we upload, we display the video with their watchale URL and delete them with UID.
Project steps
Add StepsStep description:
we define, name, description, uploaded time( auto_now) and video fields Make sure to have default and null value, otherwise you might have issues when running migrate command 1
Issues and solutions
Add IssueStep description:
-A function which takes filepath as a parameter to retrieve video watch url, video uid. We call the upload API and get the correspondent data from the response. We use requests.POST method to send requests to the api endpoint. -Upload_function. We take data such as name, description from request.FILE() and request.POT. Once we retrieve the video,we need to store them in tmp file as we need a filepath to call the API. With file path, we call the API and save the response into data base. -We have delete function to delete the specific video both from database and cloudflare stream
Issues and solutions
Add IssueStep description:
Create a virtual environment in ec2 and install all packages from requirement.txt file
Issues and solutions
Add IssueStep description:
Check out the location for django application( used for gunicorn.service), venv, and wsgi file
Issues and solutions
Add IssueStep description:
Make sure pip3 is installed within venv otherwise the downloaded packages do not work in the environment.
Issues and solutions
Add IssueStep description:
Create .service file( make sure the path for app,venv, wsgi are correct)./etc/systemd/system/ - Enable the socket and test the status of socket and services with sudo systemctl status
Issues and solutions
Add IssueStep description:
-make sure to include the ssl certificate location) - make it available with, sudo ln -s /etc/nginx/sites-available/cypher /etc/nginx/sites-enabled/
Issues and solutions
Add IssueStep description:
add cname in cloudflare( cname to ec2 public DNS name)
Issues and solutions
Add IssueIssue 1-only accept http request, no https request:- The site is only available with http not httpsUpdate Issue Delete Issue Add Solution
Solution 1-Add SSL Certificate to the nginx server config:https://www.digitalocean.com/community/tutorials/how-to-host-a-website-using-cloudflare-and-nginx-on-ubuntu-20-04Update solution Delete solution