I have the same issue as this ticket raised on the Django forum. How to solve this problem?
I also have a User model as shown below: -
class Profile(models.Model): street_address = models.CharField(max_length=80, blank=True, null=True) city = models.CharField(max_length=80, blank=True, null=True) state = models.CharField(max_length=80, blank=True, null=True) zip = models.CharField(max_length=30, blank=True, null=True) country = models.CharField(max_length=50, blank=True, null=True) phone = models.CharField(max_length=50, blank=True, null=True) birth = models.DateField(blank=True, null=True) photo = models.ImageField(upload_to='media') user = models.OneToOneField(User,primary_key=True)
But I donβt think that the problem is related to the model, because even if I delete the application containing the model from the INSTALLED_APPS list and run the manage.py migrate command, it still throws the same errors, i.e.
django.db.utils.OperationalError: (1005, "Can't create table 'db.#sql-456_113' (errno: 150)")
Without turning on any applications, the application works fine. Any guidance would be really helpful.
python django mysql
PythonEnthusiast
source share