How to create a subscription for a blog user?

Hello, I am a beginner Django developer.
For my first example I chose a small microblogging site.
About the system looks like:
  • Each user has his own blog
  • Each user can subscribe to another user and the tape will be shown the posts of whom he signed
  • The user can mark posts as read

But I can't figure out how to make a subscription for the user and news, and also how to mark read news.
Tell me, please
June 10th 19 at 14:42
1 answer
June 10th 19 at 14:44
Each post needs to be unique ID within your system.
Each user make a list of read posts.
Form the list of posts (of n users, which have subscribed to the current user), collected from every source posts, sorted by date, remove read posts. Output to the user.


Stored in the post list of users have viewed the post. The users keep a list of sources. Give the user posts, unread im.
How to create a sample of sources?
Can't understand can be a couple of lines of code example, please?

Mind only filter, and that filter send not understand. I'm confused - nikita.Stracke commented on June 10th 19 at 14:47
As it is there in Django - I don't know, I had never seen - because the code will not.
How to create a sample of sources?

As you want to remember who the user subscribed? I.e. a list of blogs, or users, do not know how it is you have planned. Go through this list and collect the posts, give the user. - chaz commented on June 10th 19 at 14:50
if you have a model user there is a field with the IDs of all users who signed.
Then everything is simple, I specify in the question that is not clear and throw the code queries the model code.
Post.objects.filter(date_pub__range=date, creator__in=users) - shani commented on June 10th 19 at 14:53

Find more questions by tags Django