1

I'm trying to make a webpage using python and mezzanine as its cms. but I got this error after successfully creating Superuser:

    Superuser created successfully.
    Traceback (most recent call last):
  File "C:\Python39\lib\site-packages\django\db\backends\utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "C:\Python39\lib\site-packages\django\db\backends\sqlite3\base.py", line 326, in execute
    return Database.Cursor.execute(self, query)
sqlite3.OperationalError: no such table: django_site__old

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

Traceback (most recent call last):
  File "C:\Users\annie\Documents\DMCproject\manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python39\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "C:\Python39\lib\site-packages\django\core\management\__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python39\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Python39\lib\site-packages\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "C:\Python39\lib\site-packages\mezzanine\core\management\commands\createdb.py", line 61, in handle
    func()
  File "C:\Python39\lib\site-packages\mezzanine\core\management\commands\createdb.py", line 109, in create_pages
    call_command("loaddata", "mezzanine_required.json")
  File "C:\Python39\lib\site-packages\django\core\management\__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "C:\Python39\lib\site-packages\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "C:\Python39\lib\site-packages\django\core\management\commands\loaddata.py", line 69, in handle
    self.loaddata(fixture_labels)
  File "C:\Python39\lib\site-packages\django\core\management\commands\loaddata.py", line 115, in loaddata
    connection.check_constraints(table_names=table_names)
  File "C:\Python39\lib\site-packages\django\db\backends\sqlite3\base.py", line 276, in check_constraints
    cursor.execute(
  File "C:\Python39\lib\site-packages\django\db\backends\utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "C:\Python39\lib\site-packages\django\db\backends\utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "C:\Python39\lib\site-packages\django\db\utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Python39\lib\site-packages\django\utils\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Python39\lib\site-packages\django\db\backends\utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "C:\Python39\lib\site-packages\django\db\backends\sqlite3\base.py", line 326, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: Problem installing fixtures: no such table: django_site__old

2 Answers 2

1

This is related to this issue in Django: https://code.djangoproject.com/ticket/29182. It is caused by a new behavior introduced in sqlite 3.26. Django has patched it in latest 2.0 and 2.1, but mezzanine does not support Django 2 yet.

The easiest fix is to not use sqlite - switch to postgres, mysql, etc. Alternatively, downgrade sqlite to < 3.26

https://github.com/stephenmcd/mezzanine/issues/1910

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same issue in a github action and I had to tweak the ubuntu version to get the preinstalled sqlite version that would work. What fixed the issue for me was to change this line:

runs-on: ubuntu-latest

to

runs-on: ubuntu-18.04

Got the ubuntu version containing the sqlite version I needed here: https://packages.ubuntu.com/search?keywords=sqlite3.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.