Skip to content

Instantly share code, notes, and snippets.

I am getting the following error "File "C:\Users\Casimir ABIRIYI\BlogAndTranslatorApp\blog\models.py", line 12, in Attachment
post = models.ForeignKey(Post, on_delete=models.CASCADE, related_name='attachments')
^^^^
NameError: name 'Post' is not defined
" if I want to 'makemigrations'. Here sre the codes of my models file "from django.db import models
from django.utils.text import slugify
from django.contrib.auth.models import User
from django.urls import reverse
import logging