# Creating the Best TODO app With the Django Master [pt.1]

### This will be a Multipart Blog, this part we will be looking at the M of MVT architecture which is Models.

I will dominate Django Very Hard with No Mercy. In this Blog we are going to create a Database to store our Todo tasks in and perform CRUD operations in that data with the help of Django's default Admin Panel

1. Create virtual environment.
    
2. Activate the virtual environment.
    
3. Install Django in the environment.
    
4. Create a Django Project named Todo.
    
5. run the Django server
    
6. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702452152375/c6ae33d7-f155-4b4a-8e30-ee709c9dba3b.png align="center")
    
    Create an app named home & add home to the installed apps list in settings.py
    
    ```python
    django-admin startapp home
    ```
    
7. Create the Model (database) for the Task
    
    ```python
    from django.db import models
    
    # Create your models here.
    
    class Task(models.Model):
        title = models.CharField(max_length=200)
        complete = models.BooleanField(default=False)
        created = models.DateTimeField(auto_now_add=True)
        expires = models.DateTimeField(auto_now_add=False,blank=True,null=True)
        
        def __str__(self):
            return self.title
        
        @property 
        def is_complete(self):
            return self.complete
    ```
    
8. Add the Model in the Admin Panel by adding it to the admin.py file
    
    ```python
    from django.contrib import admin
    from .models import Task
    
    # Register your models here.
    
    admin.site.register(Task)
    ```
    
9. Make migrations, migrate and Create superuser
    
    ```python
    py manage.py makemigrations
    py manage.py migrate
    py manage.py createsuperuser 
    ```
    
10. Run the Server and go to admin panel.
    
11. ```python
    py manage.py runserver 
    goto https://localhost:8000/admin
    ```
    
12. login to admin panel and you should see the Tasks under the Home section. Click on Tasks and do CRUD operations.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702453967109/f3f57a74-3a16-4b5c-bec3-2aaaace25b27.png align="center")

## Congratulations! You've successfully created the database for The Best Todo app ever.

## You've completed 2/900 steps of becoming a Django Master

In next Blog, we'll be looking at the V part of MVT architecture
