DEV Community

Discussion on: How to track number of hits/views for particular objects in Django | Django Packages Series #2

Collapse
 
bos1313 profile image
bos1313

Great tutorial and it works fin with Sqlite database but when I try to use it with MySQL database I got error when do migration
150 "Foreign key constraint is incorrectly formed")')
I use user field as well
user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1, on_delete=models.CASCADE)