Django errors Found

18 views Asked by At
Applying blog.0001_initial...Traceback (most recent call last):
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 87, in _execute
    return self.cursor.execute(sql)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\mysql\base.py", line 75, in execute
    return self.cursor.execute(query, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\cursors.py", line 179, in execute
    res = self._query(mogrified_query)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\cursors.py", line 330, in _query
    db.query(q)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\connections.py", line 255, in query
    _mysql.connection.query(self, query)
MySQLdb.OperationalError: (1118, 'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Django\MyAwsomeCart\mac\manage.py", line 22, in <module>
    main()
  File "D:\Django\MyAwsomeCart\mac\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\core\management\commands\migrate.py", line 356, in handle
    post_migrate_state = executor.migrate(
                         ^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\migrations\executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\migrations\executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\migrations\executor.py", line 252, in apply_migration
    state = migration.apply(state, schema_editor)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\migrations\migration.py", line 132, in apply
    operation.database_forwards(
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\migrations\operations\models.py", line 96, in database_forwards
    schema_editor.create_model(model)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\base\schema.py", line 451, in create_model
    self.execute(sql, params or None)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\base\schema.py", line 201, in execute
    cursor.execute(sql, params)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\utils.py", line 87, in _execute
    return self.cursor.execute(sql)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\django\db\backends\mysql\base.py", line 75, in execute
    return self.cursor.execute(query, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\cursors.py", line 179, in execute
    res = self._query(mogrified_query)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\cursors.py", line 330, in _query
    db.query(q)
  File "C:\Users\PC\AppData\Roaming\Python\Python311\site-packages\MySQLdb\connections.py", line 255, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1118, 'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs')

Iam getting this error when I apply py manage.py migrate

I just created a model

from django.db import models
class Blogpost(models.Model):
    post_id = models.AutoField(primary_key=True)  # Use AutoField instead of AutoField
    title = models.IntegerField()  # Corrected field name to "title"
    head2 = models.IntegerField()
    content_head2 = models.TextField(default="")
    pub_date = models.DateField()
    
    def __str__(self):
        return self.title
0

There are 0 answers