• last year
This video explains how is created a social post and saved in the database. For now, the selected accounts aren't saved. Will be possible in near future.
Transcript
00:00In this video, I'm going to explain how I'm creating the social posts using Vue.js and Django.
00:13Right now it's not possible to save the selected social accounts.
00:22For now, I will just create a post with text and image.
00:41To create the post, I will click on this button.
00:49The post was created.
00:53The post composer was built in Vue.
01:00When I enter the text into the text area, the ReactiveVModel binds the text area to the ReactivePost object and updates the text field here.
01:29The post object has even the image field which contains the selected image.
01:51When the user selects an image, I have this listener which sends the selected image to this function and the image is uploaded on the server.
02:22If the image is saved, I will save even its path to the post image field.
02:37When the user clicks on the publish button, I have a listener for clicks which calls this function.
03:01Here I'm using Axios to send the post text and image to this URL.
03:13This URL is for backend.
03:19Here, and it directs the request to the posts app.
03:34Here.
03:40And the request is handled by GridPostView class.
03:55Here I have a PostSerializer.
04:04To serialize the received data.
04:15Here I'm verifying even if the user is authenticated.
04:24Here I'm using the Serializer.
04:28Here I'm verifying if the data is valid.
04:35Then I'm getting the validated text and image and using the post model to save the post.
04:58Here I'm getting the validated text and image and using the post model to save the post.

Recommended