Activity 2.01 – creating models for a project management application
Imagine you are developing a project management application called Juggler. Juggler is an application that can track multiple projects, and each project can have multiple tasks associated with it. The following steps will help you complete this activity:
- Using the techniques we have learned so far, create a Django project called
juggler
. - Create a Django app called
projectp
. - Add the app projects to the
juggler/settings.py
file. - Create two related model classes called
Project
andTask
inprojectp/models.py
. - Create migration scripts and migrate the models’ definitions to the database.
- Open the Django shell and import the models.
- Populate the database with an example and write a query displaying the list of tasks associated with a given project.
Note
The full solution for this activity can be found on https://github.com/PacktPublishing/Web-Development-with-Django-Second-Edition/tree/main/ActivitySolutions.