O'Reilly logo

Learning Django Web Development by Ratan Kumar, Sanjeev Jaiswal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Models – designing an initial database schema

Coming back to our project, we will need two models in the initial phase: the user model and the tweet model. The user model will be used for storing the basic user details of the users that have accounts in our project.

Then comes the tweet model, which will store data related to the tweet, such as the tweet text, the user who has created that tweet, and other important details such as the timestamps of the tweet posted, and so on.

To list the tweets of a user, it will be better if we create a separate user application specific to all the users of our project. Our user models will be created by extending Django's AbstractBaseUser user model class.

Note

Changing the actual user class in your Django source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required