'Making an instagram story using rest framework django

How can i make an Instagram story using rest framework Django How can anyone make a story and how can every body in app see it



Solution 1:[1]

You are asking how one can solve a simple problem with Django. The official Django tutotorial would answer all these questions, it is crucial that you go through that as a minumum so you know what you are doing.

Fyi, once you go through the tutorial, you will realize you will need the following:

First, a model to store the data in the database.

class UserStory(models.model):
    user = models.CharField(max_length=50)
    story = models.TextField(...

Second, a view to render this data to the template along with html templates.

class UserStoryView(LoginRequiredMixin, ListView):
    model = UserStory
    template_name = 'appname/template.html'

the login required mixin for this class-based view is only visible to logged in users.

Third, in that view you need to configure access provileges that is who can see the story, who can edit, delete them and so on.

On a related note, Corey Schaffer's Django tutorial on YouTube is an excellent additional tutorial especially for beginners. Although it is slightly outdated, you should still be able to learn plenty from it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1