'django: migration x in app x has no Migration class
here is the exact error
django.db.migrations.loader.BadMigrationError: Migration 0001_initial in app django_comments has no Migration class
I have no idea what this means and I don't know where to go. I did some work with my venv, making a new one and then I was trying to get everything back to normal. Installing this and that...I lost track of everything I was doing because my laptop died which really pissed me off.
Any idea where to go from here?
EDIT:
If I try to upgrade django_comments I get the following error:
Could not find a version that satisfies the requirement django-comments (from versions: 0.2a, 0.3.1a, 0.3.2a, 0.3.3a, 0.3a, 1.0.0.b, 1.0.0.b, 1.0.0.b)
Cleaning up... No distributions matching the version for django-comments Storing debug log for failure in /home/jeff/.pip/pip.log
Solution 1:[1]
I had this problem, and it turned out that I had accidentally copied a non-migration file into one of my migrations folders. Removing the errant file fixed this for me.
Solution 2:[2]
You are probably using an old version of django-contrib-comments that only supports Django 1.6. It will have South migrations in the migrations/ folder, instead of the new Django migrations.
To fix this, simply upgrade django-contrib-comments:
pip install -U django-contrib-comments
Solution 3:[3]
For me the migration file in question was empty. Deleting it solved my problem
Solution 4:[4]
I had a file in the migration folder that didn't belong there. By deleting the misplaced file, I fixed the issue.
Solution 5:[5]
- find the root directory of python in C: drive then delete python and also delete pip.
- after deleting these both items download the new python and install it again.
Solution 6:[6]
I've shared my Django ORM DB model between my custom APP and a Django App via symbolic links: ln -s
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AlexJerez |
| Solution 2 | |
| Solution 3 | 7guyo |
| Solution 4 | Ramone_Henry |
| Solution 5 | yahya |
| Solution 6 | Simon Crane |
