from django.db import models
from django.utils import timezone

class Post(models.Model):
    title = models.CharField(max_length=200)
    author = models.CharField(max_length=100)
    tags = models.CharField(max_length=200)
    pub_date = models.DateTimeField(blank=True, null=True)
    text = models.TextField()

    def publish(self):
        self.pub_date = timezone.now()
        self.save()

    def __str__(self):
        return self.title

from django.db import models
from django.utils import timezone

class Post(models.Model):
    title = models.CharField(max_length=200)
    pub_date = models.DateTimeField(blank=True, null=True)
    text = models.TextField()

    def __str__(self):
        return self.title

Remove tags and fixed .gitignore
Remove tags and fixed .gitignore

  from django.db import models
  from django.utils import timezone
  
  class Post(models.Model):
      title = models.CharField(max_length=200)
-     author = models.CharField(max_length=100)
-     tags = models.CharField(max_length=200)
      pub_date = models.DateTimeField(blank=True, null=True)
      text = models.TextField()
- 
-     def publish(self):
-         self.pub_date = timezone.now()
-         self.save()
  
      def __str__(self):
          return self.title
  
Remove tags and fixed .gitignore
## Code Before:
from django.db import models
from django.utils import timezone

class Post(models.Model):
    title = models.CharField(max_length=200)
    author = models.CharField(max_length=100)
    tags = models.CharField(max_length=200)
    pub_date = models.DateTimeField(blank=True, null=True)
    text = models.TextField()

    def publish(self):
        self.pub_date = timezone.now()
        self.save()

    def __str__(self):
        return self.title

## Instruction:
Remove tags and fixed .gitignore
## Code After:
from django.db import models
from django.utils import timezone

class Post(models.Model):
    title = models.CharField(max_length=200)
    pub_date = models.DateTimeField(blank=True, null=True)
    text = models.TextField()

    def __str__(self):
        return self.title
